Solved Click on a player with an item and make something

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

drawerti

Member
Apr 26, 2021
3
0
1
21
I want to make a script when i click on a player with a blaze rod, the player get the slowness effect and when i click on the player with de blaze rod again, the effect gone. Anyone have an idea how to do this?
 
Last edited:
Code:
on right click on player:
  if player is holding a blaze rod:
    if {%clicked player%.hasslowness} is 1:
      apply slowness 2 to clicked player
      set {%clicked player%.hasslowness} to 0
    else:
      remove slowness from clicked player
      set {%clicked player%.hasslowness} to 1

Maybe try something like this
 
Code:
on right click on player:
  if player is holding a blaze rod:
    if {%clicked player%.hasslowness} is 1:
      apply slowness 2 to clicked player
      set {%clicked player%.hasslowness} to 0
    else:
      remove slowness from clicked player
      set {%clicked player%.hasslowness} to 1

Maybe try something like this
It worked! Thank you so much, do you have an ideia to how send a message for the player wich has the slowness effect?
 
Status
Not open for further replies.