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.

Kick player for attacking cow

Discussion in 'Requests' started by Angelfish, Jan 13, 2020.

  1. Angelfish

    Angelfish Member

    Joined:
    Jan 13, 2020
    Messages:
    2
    Likes Received:
    0
    This is the script I currently have:

    on entity target:
    (tab)target is cow
    (tab)if {attacks.%uuid of player%} is not set:
    (tab)(tab)set {attacks.%uuid of player%} to 1
    (tab)if {attacks.%uuid of player%} >= 3:
    (tab)(tab)kick player because of "Cow Harm"

    it doesn't work though
     
  2. Zabrid

    Supporter

    Joined:
    Mar 2, 2019
    Messages:
    47
    Likes Received:
    1
    Code (Text):
    1.  
    2. on damage:
    3.     if attacker is a player:
    4.         if victim is a cow:
    5.             kick attacker due to "&cLOL"
    this isn't quite what you wanted but it should work, also you can update it very easily
     
    • Like Like x 1
  3. Angelfish

    Angelfish Member

    Joined:
    Jan 13, 2020
    Messages:
    2
    Likes Received:
    0
    i don't want it to be first hit though
     
  4. Zabrid

    Supporter

    Joined:
    Mar 2, 2019
    Messages:
    47
    Likes Received:
    1
    Code (Text):
    1.  
    2. on damage:
    3.     if attacker is a player:
    4.         if victim is a cow:
    5.             if {cow.attack::%uuid of player%} is not set:
    6.                 set {cow.attack::%uuid of player%} to 3
    7.                 send "&cDo not attack cows. If you don't stop you will be kicked. &7(1/3)"
    8.             else:
    9.                 if {cow.attack::%uuid of player%} is equal to 2:
    10.                     kick player due to "&cI told you to stop attacking cows. &7(3/3)"
    11.                     delete {cow.attack::%uuid of player%}
    12.                 if {cow.attack::%uuid of player%} is equal to 1:
    13.                     add 1 to {cow.attack::%uuid of player%}
    14.                     send "&cDo not attack cows. If you don't stop you will be kicked. &7(2/3)"
    15.  
    16. on quit:
    17.     delete {cow.attack::%uuid of player%}
    optimised not to crash your server with to many variables (may have errors did not test)
     
Loading...