Anti-fly help??

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

ItzarReal

Member
Oct 21, 2020
19
0
1
23
Okay, so i want to make an anticheat that informs me when someone is flying. Please help!! I dont even know where to start with my code

Okay so heres my code:
player is flying:
trigger:
send "%player% is hacking!" to "ItzarReal" parsed as player
 
Last edited:
first of all trigger do you use ONLY if u start a command, not function ONLY COMMAND
and second send ur logs/errors
 
Code:
every second:
  loop all players:
    if loop-player has permission "essentials.fly":
    else:
      if loop-player's flight state is true:
        if loop-player's gamemode is survival:
          send "%loop-player% is hacking" to "ItzarReal" parsed as player
[doublepost=1603983568,1603983518][/doublepost]i didnt test it so it might not work
 
Code:
every second:
  loop all players:
    if loop-player has permission "essentials.fly":
    else:
      if loop-player's flight state is true:
        if loop-player's gamemode is survival:
          send "%loop-player% is hacking" to "ItzarReal" parsed as player
[doublepost=1603983568,1603983518][/doublepost]i didnt test it so it might not work

This might lag the server and there is unnecessary code. Btw. i am talking this up there ^^ xD

Code:
on flight toggle:
    player's gamemode is survival or adventure
    player doesn't have permission "essentials.fly"
    send "%player% is hacking" to "ItzarReal" parsed as player

This is how I would do it
 
b R u H
Code:
on flight toggle:
    player's gamemode is survival or adventure:
      player doesn't have permission "essentials.fly":
        send "%player% is hacking" to "ItzarReal" parsed as player
thats better
 
My Anticheat Hydra has a fly check in it, this is it
Code:
on any move:
    player does not have permission "hydra.bypass.fly"
    player's gamemode is survival or adventure
    player's flight mode is false
    set {_y1} to y pos of player
    wait 2 ticks
    set {_y2} to y pos of player
    difference between {_y1} and {_y2} is more than 0.3
    {_y1} < {_y2}
    difference between {log.%player%} and now is more than 0.5 seconds
    difference between {reload.%player%} and now is more than 5 seconds
    if {fly} is true:
        add 1 to {fly::%player%}
        if {fly::%player%} >= 3:
            alert(player, "Fly")
            teleport player to {rubberband.%player%}
            add 1 to {alerts::%player%}
            add 1 to {flightlogs::%player%}
            if {alerts::%player%} >= 10:
                if {kick_10_alerts} is true:
                    hydrApi_kickPlayer(player)

The variables teleport player to {rubberband.%player%}. difference between {log.%player%} and now is more than 0.5 seconds, difference between {reload.%player%} and now is more than 5 seconds are here
Code:
every 5 ticks:
    loop all players:
        set {_loc} to location of loop-player
        loop all blocks in radius 2.5 around {_loc}:
            if loop-block is not air:
                set {log.%loop-player%} to now
                set {rubberband.%loop-player%} to location of loop-player
                
        the gliding state of loop-player is true:
            loop-player's chestplate is elytra:
                set {log.%loop-player%} to now
                
        loop-player is flying:
            set {lastflying::%loop-player%} to now
 
My Anticheat Hydra has a fly check in it, this is it
Code:
on any move:
    player does not have permission "hydra.bypass.fly"
    player's gamemode is survival or adventure
    player's flight mode is false
    set {_y1} to y pos of player
    wait 2 ticks
    set {_y2} to y pos of player
    difference between {_y1} and {_y2} is more than 0.3
    {_y1} < {_y2}
    difference between {log.%player%} and now is more than 0.5 seconds
    difference between {reload.%player%} and now is more than 5 seconds
    if {fly} is true:
        add 1 to {fly::%player%}
        if {fly::%player%} >= 3:
            alert(player, "Fly")
            teleport player to {rubberband.%player%}
            add 1 to {alerts::%player%}
            add 1 to {flightlogs::%player%}
            if {alerts::%player%} >= 10:
                if {kick_10_alerts} is true:
                    hydrApi_kickPlayer(player)

The variables teleport player to {rubberband.%player%}. difference between {log.%player%} and now is more than 0.5 seconds, difference between {reload.%player%} and now is more than 5 seconds are here
Code:
every 5 ticks:
    loop all players:
        set {_loc} to location of loop-player
        loop all blocks in radius 2.5 around {_loc}:
            if loop-block is not air:
                set {log.%loop-player%} to now
                set {rubberband.%loop-player%} to location of loop-player
              
        the gliding state of loop-player is true:
            loop-player's chestplate is elytra:
                set {log.%loop-player%} to now
              
        loop-player is flying:
            set {lastflying::%loop-player%} to now
Yea, ive got an anyocheat too. The thing about these skript antihelt, is that they lag the server as heck. Ph0enix,a youtuber has a good anticheat tho

Lol my phone likes autocorrect

Yea, ive got an anticheat too. The thing about these skript anticheats, is that they lag the server as heck. Ph0enix,a youtuber has a good anticheat tho
 
Last edited:
Status
Not open for further replies.