Jump to content

Anti Naked Kill Skript


HumanZombie

Recommended Posts

I was looking through forums and found a skript for anti naked killing:

on damage of player:
  if attacker is a player:
    if victim isn't wearing armor:
      cancel event
      send "&c&lHey!&7 You can't kill unarmored players." to attacker
    if attacker isn't wearing armor:
      if victim is wearing armor:
        cancel event
        send "&c&lHey!&7 You can't kill players while not wearing armor." to attacker
Creds: 8pixel

I dont know how to skript myself so I thought I would ask here. How would I make it so they still cant be attacked 
if they have armour in their inventory, enderchest and pvault. I am using these plugins: 
https://www.spigotmc.org/resources/personal-vaults.75159/ 
https://www.spigotmc.org/resources/custom-enderchest.8868/
Link to comment
Share on other sites

That should already be a thing. In this case, the skript only allows pvp if both players are wearing armor. Having armor in a PV, Enderchest, or simply in their inventory does not count as wearing it, so they should be protected regardless. 

If I got your post request wrong, let me know lol

  • Confused 1
Link to comment
Share on other sites

For the inventory, you could do something like this (untested, but should work in theory)

if victim's inventory contains armor:

As for the Enderchest/PVs, I'm not quite sure, since Skript does not have integration into the plugin Personal Vaults (as far as I'm aware).

For Enderchest, you are using a Custom Enderchest plugin, which likely creates a Custom GUI and completely replaces the default Enderchest, so Skript's Enderchest support would not function for it.

I do not know quite what to do for the PVs and EnderChests, but hopefully the inventory bit helps!

 

Edited by LunarBurn1
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...