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

FireRoz

Active Member
May 28, 2020
133
6
18
Yo whatsup I wanna create a skript that when you enter a __global__ region you cannot do /fly anymore, and I know what you're thinking:
BUT YOU STUPID IDIOT YOU CAN DO IT ON WORLDGUARD AND ADD TO ADMINS WORLDGUARD.REGION.BYPASS.__GLOBAL__
well, here is the thing! I don't want normal players to fly there, But I want moderators to fly there and if they can bypass the region rules, then they will be able to build. I want that once you enter a specific region without the permission region.fly you will not be able to do /fly anymore.
thanks lmao
 
Should work, untested, but may need some tweaks.
(could probably be cleaner, but hey, its a 10 min thing.
replace {forbidden region} with what ever, this is mostly copy paste from the docs.
code_language.skript:
on region enter:
     region is {forbidden region}
     if player does not has permission "region.fly":
         make player execute command "/fly"
on command:
    if region is {forbidden region} is true:
        if the command is "fly":
            if player does not has permission "region.fly":
                cancel event
 
Yo whatsup I wanna create a skript that when you enter a __global__ region you cannot do /fly anymore, and I know what you're thinking:
BUT YOU STUPID IDIOT YOU CAN DO IT ON WORLDGUARD AND ADD TO ADMINS WORLDGUARD.REGION.BYPASS.__GLOBAL__
well, here is the thing! I don't want normal players to fly there, But I want moderators to fly there and if they can bypass the region rules, then they will be able to build. I want that once you enter a specific region without the permission region.fly you will not be able to do /fly anymore.
thanks lmao
code_language.skript:
on region enter:
    if "%region at player%" contains "NoFlyRegion":
        if player's flight mode is true:
            set player's flight mode to false
on command "/fly":
    if "%region at player%" contains "NoFlyRegion":
        if player does not have permission "staff.fly":
            cancel event
            send "§cYou cant use this command in this region." to player
        else:
            uncancel event
Didnt tested.
 
While It may not be great practice, I don't think you need the additional else statement there couger
Otherwise, I would prob recommend couger's code over mine.
 
While It may not be great practice, I don't think you need the additional else statement there couger
Otherwise, I would prob recommend couger's code over mine.
What? The creator of the post has the option to choose. I just commented on what I think the code he asks for would be.
 
What? The creator of the post has the option to choose. I just commented on what I think the code he asks for would be.
I mean ya, but with my code untweaked some brilliant lad could go, wait, it just sends the command, I could just pop in there without fly and get flight again. But ya, they do have the option to choose.
 
I mean ya, but with my code untweaked some brilliant lad could go, wait, it just sends the command, I could just pop in there without fly and get flight again. But ya, they do have the option to choose.
I don't speak perfect English, so I don't fully understand what you're trying to tell me, but the code I sent is based on one I made a long time ago when I had a server.
upload_2020-6-24_22-56-3.png
 
Oh, apologies, haven't really been using this community's forums for that long, I was just pointing out that there was a major flaw in my code that could be abused to get flight in regions that they are not supposed to.
 
  • Like
Reactions: couger44
Oh, apologies, haven't really been using this community's forums for that long, I was just pointing out that there was a major flaw in my code that could be abused to get flight in regions that they are not supposed to.
No problem. As I said earlier, I don't understand English perfectly nor its "idioms", so it's not your fault.
 
Status
Not open for further replies.