Item variable

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

titustitus98

Member
Feb 19, 2018
47
0
6
25
Hi how do I add a variable to an item?
Like if I use %player% it will link the var to the player and if I use %player's tool% it links it to the item type of the tool of the player but not to the actual item, so how do I do that?
 
player's tool will be an item, not item type. You can confirm that by using name of tool of player or lore of tool of player.
 
player's tool will be an item, not item type. You can confirm that by using name of tool of player or lore of tool of player.
Yeah but the problem with that is that then if a player has an item with the same name or lore then it will be applied to it too
 
Oh, you mean when you remove tool of player from player's inventory or something like that? You can use slot hotbar slot of player of player.
EDIT: you might have to use a local variable for hotbar slot of player
 
Oh, you mean when you remove tool of player from player's inventory or something like that? You can use slot hotbar slot of player of player.
EDIT: you might have to use a local variable for hotbar slot of player
I mean I am trying to make custom enchants but when I use player's tool it will add the enchant to all items that are the same type.
For example if I enchant a diamond pickaxe with explosive 1 all diamond pickaxe will act like they have explosive
 
Can you show your code?
 
No I have {explosive::%player's tool%} that I set the enchantment level to
Yes, that's because using %% will convert it to a string, and converting items to text in Skript only includes item types. You can use set {explosivetool::%player%} to player's tool (or something like that).
 
Status
Not open for further replies.