Check if player was in region

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

DavidWasHere

New Member
Nov 14, 2020
6
0
1
23
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​
 
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:
 
Status
Not open for further replies.