Shield blocking with stick

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

Xofays

New Member
Jan 18, 2024
7
0
1
24
my english is not that good but im going to try to explain what i want to do.

I want to make a script like when you hit a player with a stick while the player is
shielding it deactivates his shield

here is a link as a demonstration:

I tried to do it but it doesn't work
 
Code:
on damage with stick:
  if victim is blocking:
    set {_item} to victim's off hand tool
    set the off hand item of victim to air
    wait 1 tick
    set the off hand item of victim to {_item}
    set item cooldown of shield for victim to 5 seconds

doesnt remove the durability but should still work
 
1726241127521.png

Code:
on damage with stick:
  if victim is blocking:
    set {_item} to victim's off hand tool
    set the off hand item of victim to air
    wait 1 tick
    set the off hand item of victim to {_item}
    set item cooldown of shield for victim to 5 seconds

doesnt remove the durability but should still work
 
fixed, but i changed a bit of the code and i want to make that the attacker has a countdown too like he has to wait 10 seconds before attacking again