Limit world guard region to 2 players

  • 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 community!

    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!

klxud

Member
Jul 23, 2023
2
0
1
Hey i wanna make skript that makes some world guard regions limited. Need it for my boss arenas for 2-4 people. I dont really know how should i start.
 
Code:
on region enter:
    if {Plrs} isn't 2:
        "%region at player%" contains "test":
            add 1 to {Plrs}
    else:
        cancel event
        send "Sorry! The region has the max amount of players (2)!" to player

on region exit:
    "%region at player%" contains "test":
    remove 1 from {Plrs}
You could try something like this. I'm not really experienced when it comes to region expressions and such so it's possible that preventing the player from entering a region couldn't be stopped with "cancel event". However, it's worth a shot to test this code I wrote out and modify it as needed!
 
  • Like
Reactions: klxud