make player can fly only in a own region 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.

Trickered

New Member
Feb 1, 2022
6
0
1
21
skript version : 2.6
author: Trickered
minecraft version : 1.18.1

i was created a skript that can make player fly in owned region but i have a issue that i can't fix when player move to other region (the player is owned that that too) skript disabled his fly
i using protection stone to let player create his region

i only want to make a group can fly not everyone

there is no error when reload

Code:
on region enter:
    if player is the owner of the region:
        if player has permission "emzencore.flyable":
            message "&eYou have &bPlayPlus&6+ &eYou're allowed to fly!" to player
            play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to player
            allow flight to player
            stop

on region exit:
    if player has permission "emzencore.flyable":
        if region contains "__global__":
            disallow flight to player

*on region exit event i just trying after the issue
maybe my english is bad i'm thai sorry

addon using:
SkUniversal v.2.13
SkRayFall v.1.9.26
SkQuery v.4.1.6

Troubleshooting:
i have tried searching docs
i have searching forums (maybe i missed because my english not so good to find the keywords)
i try using "on region enter that contains "__global__""
i try using extra world guard flags to disallow fly only in __global__
 
try
Code:
on region enter:
    if player has permission "emzencore.flyable":
        loop owners of region:
            if loop-value-1 is player:
                message "&eYou have &bPlayPlus&6+ &eYou're allowed to fly!" to player
                play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to player
                set flight mode of player to true
                stop loop
 
on region exit:
    if player has permission "emzencore.flyable":
        loop owners of region:
            if loop-value-1 is player:
                stop
        set flight mode of player to false
 
try
Code:
on region enter:
    if player has permission "emzencore.flyable":
        loop owners of region:
            if loop-value-1 is player:
                message "&eYou have &bPlayPlus&6+ &eYou're allowed to fly!" to player
                play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to player
                set flight mode of player to true
                stop loop
 
on region exit:
    if player has permission "emzencore.flyable":
        loop owners of region:
            if loop-value-1 is player:
                stop
        set flight mode of player to false

it seem to work better but the player still can fly when they leave their region like going to __global__
 
Status
Not open for further replies.