How make item work with attributes

  • 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 community!

    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!

Apr 16, 2023
2
0
1
The right click ability doesn't work when there's attributes on the item. How do I fix this


on join:
set {%player%.debt} to 0

on right click:
if player's held item is a stick named "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
if {%player%.debt} is 0:
push player forward at speed 1.6
push player up at speed 0.2
wait 0.5 seconds
create a safe explosion of force 2 at player
kill entities in radius 4 around player
set {%player%.debt} to 1
wait 1 seconds
set {%player%.debt} to 0
else:
send "&7This is on cooldown!"

on damage of player:
if attacker is a player:
if attacker's item is a stick:
if name of attacker's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
kill victim

on damage:
if victim is a player:
if victim's item is a stick:
if name of victim's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
cancel event
 
The right click ability doesn't work when there's attributes on the item. How do I fix this


on join:
set {%player%.debt} to 0

on right click:
if player's held item is a stick named "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
if {%player%.debt} is 0:
push player forward at speed 1.6
push player up at speed 0.2
wait 0.5 seconds
create a safe explosion of force 2 at player
kill entities in radius 4 around player
set {%player%.debt} to 1
wait 1 seconds
set {%player%.debt} to 0
else:
send "&7This is on cooldown!"

on damage of player:
if attacker is a player:
if attacker's item is a stick:
if name of attacker's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
kill victim

on damage:
if victim is a player:
if victim's item is a stick:
if name of victim's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
cancel event
Hi, I know how to fix that, but I'm on a tablet right now so wait like 14 hours from me posting this, and ill send my indented and edited script.
 
first imma show you how to use a code block
Code:
This is a code block!
How make item work with attributes _ skUnity Forums - Google Chrome 9_6_2023 9_46_29 AM.jpg
 
The right click ability doesn't work when there's attributes on the item. How do I fix this


on join:
set {%player%.debt} to 0

on right click:
if player's held item is a stick named "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
if {%player%.debt} is 0:
push player forward at speed 1.6
push player up at speed 0.2
wait 0.5 seconds
create a safe explosion of force 2 at player
kill entities in radius 4 around player
set {%player%.debt} to 1
wait 1 seconds
set {%player%.debt} to 0
else:
send "&7This is on cooldown!"

on damage of player:
if attacker is a player:
if attacker's item is a stick:
if name of attacker's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
kill victim

on damage:
if victim is a player:
if victim's item is a stick:
if name of victim's item is "&4&krrrrr&4&lDebt Collector&4&l&krrrrr":
cancel event
Just saying, you could just use the Item Edit plugin.
Item editor is essentialy the same thing just with a gui