How to run a command when joining an area

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

xiShaDow_

New Member
Jul 21, 2019
6
0
0
19
Hey guys..
How to run a command if a player leaves or joins a specific area and how can i add the coordinates of this area to skript or adding it in a more simple way..
 
if the player is teleported using a command, you could make it so it runs the command after the first command is executed

example:

execute console command "/tp %player% 0 123 0"
wait _ seconds
execute console command "/effect %player% wither"
[doublepost=1563724407,1563724370][/doublepost]the wait part isn't required, just adds a delay
 
How to run a command if a player leaves or joins a specific area and how can i add the coordinates of this area to skript or adding it in a more simple way..

You first need to set the area with a plugin like worldguard. Then, you need to find the addon for skript that works with worldguard. I dont remember which one is. Use the docs.
 
You first need to set the area with a plugin like worldguard. Then, you need to find the addon for skript that works with worldguard. I dont remember which one is. Use the docs.

Isn't there any other way ? can't i make the region with skript ? cuz the addon is not working...
[doublepost=1563767821,1563767703][/doublepost]
if the player is teleported using a command, you could make it so it runs the command after the first command is executed

example:

execute console command "/tp %player% 0 123 0"
wait _ seconds
execute console command "/effect %player% wither"
[doublepost=1563724407,1563724370][/doublepost]the wait part isn't required, just adds a delay

Isn't there a way to use the coordinates to make a region in skript itself ?
 
I don't think there is, sadly. If there was, you'd have to make the region selector in skript, then create variables to mark each location, which i'm not sure is possible.
 
The thing is, what will be the trigger to start checking the player position? And this trigger probably would take alot of resources. Is not a good thing to do with skript. WolrdGuard is very lightweight, you should use it for creating the region.

Also, you can set in worldguard commands to be executed by the player when he enters a area or leaves a area.
 
Status
Not open for further replies.