Hey guys, i got this piece of code working:
But the problem here is, if it steals a piece of armor that is equiped, the armor will duplicate. Both players will now have the armor.
Is there a way to fix this? That the player that is stealed from, will unequip and lose his armor?
code_language.skript:
on right-click on player:
if player is holding a enchanted book named "&8Steal-Book" with lore "&7Right-click a player to steal something from him.":
delete {steal::*}
wait a tick
loop all items in clicked player's inventory:
if loop-item is not enchanted with curse of vanishing 1:
add loop-item to {steal::*}
set {stealed} to random element out of {steal::*}
add {stealed} to player's inventory
remove {stealed} from clicked player's inventory
send "&8You stole %{stealed}% from %clicked player%!" to player
send "&8%{stealed}% has been stolen from you!" to clicked player
remove a enchanted book named "&8Steal-Book" with lore "&7Right-click a player to steal something from him." from the player
delete {steal::*}
delete {stealed}
But the problem here is, if it steals a piece of armor that is equiped, the armor will duplicate. Both players will now have the armor.
Is there a way to fix this? That the player that is stealed from, will unequip and lose his armor?