#(Head_Star) How do I use the item flag? I'm making a gun.

48 messages · Page 1 of 1 (latest)

gusty pawn
eternal edgeBOT
#

(Head_Star) How do I use the item flag? I'm making a gun.

eternal edgeBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

charred helm
#

Could you post your script as Denizen script to the paste site please.

#

!paste

weary vergeBOT
charred helm
#

You've posted it as C# for some reason

gusty pawn
#

oh sorry

#

Here it is.

charred helm
weary vergeBOT
charred helm
#

!guide long term storage

weary vergeBOT
#
Possible Confusion

Did you mean to search for long term memory: flags?

weary vergeBOT
charred helm
#

Flags are explained in the guide

#

If you're using sub maps as you do at line 41, you separate each key with a . when reading the flag with the appropriate tag.

gusty pawn
#

What if I change it like this?

charred helm
#

Well then each sub key of flags becomes it's own flag.

#

ie; you have a flag called headdamage on the item that has the value of 100

#

Are these default values for the weapon?

#

If so, I'd suggest using a data key instead and read from that, so you're able to modify values any time easily.

#

If you create an item with flags attached it won't update ingame if you change the values in your Item script.

gusty pawn
#

I don't understand well because I am not good at English. So you might be frustrated.

#

I'm going to make weapons like this for now.

#

And I want to make it like this.

charred helm
#

!t script.data_key

weary vergeBOT
# charred helm !t script.data_key

Returns the value from a data key on the script as an ElementTag, ListTag, or MapTag.
For example, "script.data_key[type]" on a task script will return "task".
Custom keys should usually go in a 'data' script container, or under a key labeled 'data' for other script containers.

Returns

ObjectTag

gusty pawn
#

Wow, thank you. I'll try it.

#

Oh, it works! But there's a problem.

#

If I hold a headgun, can I bring a stat of headgun, and if I hold a stargun, can I bring a stat of stargun?

heavy depot
#

!t ItemTag.script

weary vergeBOT
heavy depot
#

You can get the ScriptTag of a specific item - get the script of the gun the player is holding, then read the data from that script

gusty pawn
#

Wow, it's working!
I love you so much.