1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Trigger when player stands on pressure plate

Discussion in 'Skript' started by iStopcontact, Apr 1, 2017.

Thread Status:
Not open for further replies.
  1. iStopcontact

    iStopcontact Member

    Joined:
    Feb 18, 2017
    Messages:
    111
    Likes Received:
    2
    Hello guys, I'm working on my own Parkour skript, and now i want to have that when a player stands on a golden pressure plate it wil set the checkpoint.
    I found the command to make it do something for all pressure plate:
    Code (Skript):
    1. on stepping on a pressure plate:
    2.     if {kitpvp:join:%player%} is false:
    3.         send "test" to player
    4.     if {kitpvp:join:%player%} is true:
    5.         cancel event
    But how can i do my code to do it for example:
    Only when player stand on golden pressure plate or iron pressure plate.
     
  2. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,171
    Likes Received:
    180
    Try this.
    Code (Skript):
    1. on stepping on a pressure plate:
    2.     if event-player is player:
    3.         if {kitpvp:join:%player%} is false:
    4.             send "test" to player
    5.         if {kitpvp:join:%player%} is true:
    6.             cancel event
     
  3. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,171
    Likes Received:
    180
    @iStopcontact

    Code (Skript):
    1. event-block is a golden pressure plate
    2. event-block is an iron pressure plate
     
  4. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,171
    Likes Received:
    180
    @YoshYz Ty that worked, but how can i make it now that it has a kind of delay.
    Because now when i player stands on the pressure plate it keeps replaying that command but i only want it once
     
  5. ShaneBee

    Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,171
    Likes Received:
    180
    Something like that should work:
    Code (Skript):
    1. on stepping on a pressure plate:
    2.     event-block is a golden pressure plate
    3.     {delay::%uuid of player%} isn't set
    4.     if {kitpvp:join:%player%} is false:
    5.         send "test" to player
    6.     if {kitpvp:join:%player%} is true:
    7.         cancel event
    8.     while block 1 blocks below player is a golden pressure plate:
    9.         set {delay::%uuid of player%} to true
    10.         wait 1 second
    11.     delete {delay::%uuid of player%}
     
Thread Status:
Not open for further replies.
Loading...