Fly Command

  • 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.
Aug 19, 2017
10
0
0
34
Hai there,
I am making a fly script and I am fairly new to script and need some help.
My script:
code_language.skript:
command /fly:
    trigger:
        if command sender is console:
            send "&2&lMCM &8» &aThis command can only be executed by a player!"
        if command sender is player:
            if {rank::%player's uuid%} is not "vip+" or "mvp" or "legend" or "helper" or "moderator" or "admin" or "developer" or "owner":
                send "&2&lMCM &8» &cYou must be &a&lVIP&b&+ &cto use this!"
            if {rank::%player's uuid%} is "vip+" or "mvp" or "legend" or "helper" or "moderator" or "admin" or "developer" or "owner":
                if {flight::%player's uuid%} is not set:
                    set {flight::%player's uuid%} to true
                    set player's flight mode to true
                    send "&2&lMCM &8» &aYour flight mode was &benabled&a!"
                else:
                    set player's flight mode to false
                    delete {flight::%player's uuid%}
                    send "&2&lMCM &8» &aYour flight mode was &bdisabled&a!"
If the players flight is enabled and the player logs out then later comes back online, I want the flight mode to be enabled again and if the player is falling for the player to stop falling. I was told packets could do this but I don't know anything about packets

Thank you for any help
 
If I understand you correctly, just add an "on join:" event, add a wait, then check if flight variable is true. I don't see why you need packets for this.
 
Perhaps it would be easier to just make them invulnerable if they connect while they're flying (which can be easily done checking if the block behind the player is air), if your problem is people dying when reconnecting.

If it's just to be fancy, you can send the packet 0x2C (player abilities) to the player and set the flag field to 0x02 (flying) using MundoSK packets. You also need to send 0x13 with the same value on the flag field to the server. I think, that's what I got from http://wiki.vg/Protocol

...I can't be more specific because i don't know how, tho.
 
Perhaps it would be easier to just make them invulnerable if they connect while they're flying (which can be easily done checking if the block behind the player is air), if your problem is people dying when reconnecting.

If it's just to be fancy, you can send the packet 0x2C (player abilities) to the player and set the flag field to 0x02 (flying) using MundoSK packets. You also need to send 0x13 with the same value on the flag field to the server. I think, that's what I got from http://wiki.vg/Protocol

...I can't be more specific because i don't know how, tho.
that's not the right packet and that isn't what you would do even if it was
 
Status
Not open for further replies.