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.

Check if player was in region

Discussion in 'Skript' started by DavidWasHere, Nov 19, 2020.

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

    DavidWasHere New Member

    Joined:
    Nov 14, 2020
    Messages:
    6
    Likes Received:
    0
    So, i am doing a little checkpoint skript that when a player passes the region it gives him money and sets his spawn, but i dont want the player to be able to get the reward everytime he passes the region, how do i do that?

    My code:
    on region enter:
    if "%region%" contains "checkpoint1":
    make console execute command "/addcoins 200 %player%"
    make console execute command "/spawnpoint %player% 10 18 144"

    if "%region%" contains "checkpoint2":
    make console execute command "/addcoins 200 %player%"
    make console execute command "/spawnpoint %player% 24 26 214"

    I've also tried this, but it didnt work:


    on region enter:
    if "%region%" contains "checkpoint1":
    if player has permission "{checkpoint.checkpoint1}":
    cancel event
    else:
    make console execute command "/addcoins 200 %player%"
    add "checkpoint.checkpoint1" to player's permissions

    if "%region%" contains "checkpoint2":
    if player has permission "{checkpoint.checkpoint2}":
    cancel event
    else:
    make console execute command "/addcoins 200 %player%"
    add "checkpoint.checkpoint2" to player's permissions​
     
  2. Marc

    Marc Active Member

    Joined:
    Nov 27, 2020
    Messages:
    94
    Likes Received:
    0
    You could make it so when the player enters wait 10 ticks and tp them to the next block,
    Ive tried to add on the this command but I havent found anything that works.
    you could try and do something with loop-players to update it to see if the player has been in their or not
    but other than that I rlly cant help you and I wish you good luck :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...