1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anti AFK Fish Farm

Discussion in 'Snippets' started by jaylawl, Jan 1, 2018.

  1. jaylawl

    jaylawl Active Member

    Jan 29, 2017
    Likes Received:
    This is the full script, not a snippet. I don't know where else to post this. Apparently i'm not qualified to post in the regular Scripts subforum. Whatever.

    AFK Fish Farming is based on leaving your game while it constantly right clicks. This script will detect that by comparing the player's location with their previous one (mind that locations also include yaw and pitch!), whenever a player casts a fishing rod. The way the script is posted right now, players will get kicked after casting a fishing rod 10 time in a row without changing their location at all.

    This will never affect players who are fishing regularly. If you are paranoid though, you could increase the needed infraction count.

    tl;dr = kicks AFK-fish farmers, doesn't affect regular fishing

    Code (Skript):
    1. on script load:
    3.     delete {aaf.location::*} and {aaf.infractions::*}
    5. on fish:
    7.     if {aaf.location::%event-player%} is not set:
    8.         set {aaf.location::%event-player%} to event-player's location
    10.     else if {aaf.location::%event-player%} = event-player's location:
    11.         add 1 to {aaf.infractions::%event-player%}
    13.         if {aaf.infractions::%event-player%} >= 10:
    14.             delete {aaf.infractions::%event-player%} and {aaf.location::%event-player%}
    15.             kick event-player due to "AFK-Fishing is not allowed"
    16.             # broadcast "&c%event-player% has been kicked for AFK-Fishing"
    18.     else if {aaf.location::%event-player%} != event-player's location:
    19.         delete {aaf.infractions::%event-player%} and {aaf.location::%event-player%}
    Laukage likes this.

Share This Page