Kick player for attacking cow

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

Angelfish

Member
Jan 13, 2020
2
0
0
43
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
 
Code:
on damage:
    if attacker is a player:
        if victim is a cow:
            kick attacker due to "&cLOL"
this isn't quite what you wanted but it should work, also you can update it very easily
 
  • Like
Reactions: MasonsBunker
Code:
on damage:
    if attacker is a player:
        if victim is a cow:
            kick attacker due to "&cLOL"
this isn't quite what you wanted but it should work, also you can update it very easily
i don't want it to be first hit though
 
Code:
on damage:
    if attacker is a player:
        if victim is a cow:
            if {cow.attack::%uuid of player%} is not set:
                set {cow.attack::%uuid of player%} to 3
                send "&cDo not attack cows. If you don't stop you will be kicked. &7(1/3)"
            else:
                if {cow.attack::%uuid of player%} is equal to 2:
                    kick player due to "&cI told you to stop attacking cows. &7(3/3)"
                    delete {cow.attack::%uuid of player%}
                if {cow.attack::%uuid of player%} is equal to 1:
                    add 1 to {cow.attack::%uuid of player%}
                    send "&cDo not attack cows. If you don't stop you will be kicked. &7(2/3)"

on quit:
    delete {cow.attack::%uuid of player%}
optimised not to crash your server with to many variables (may have errors did not test)