im trying to make it so the if the player is in that world they take damage unless they have the correct player head on. it works if i change to to if a player is wearing a helmet but i want it to be a with the /hat command item or player head
Posted by: madtrent. from the skUnity Discord. View the thread on skUnity Discord here
code_language.skript:
every 1 tick:
if {@World damage} is true:
loop all players:
if world of loop-player is "{@world}":
if loop-player has permission "{@world damage permission}":
stop
if loop-player is wearing a player head:
if name of player head is "{@helmet1.name}":
if player head is enchanted with {@helmet1.enchantment} {@helmet1.enchantlvl}:
stop
if {_vanished} is "Yes":
stop
set {{@world}_entry_timer.%loop-player%} to {{@world}_entry_timer.%loop-player%} + 1
if {{@world}_entry_timer.%loop-player%} is greater than or equal to {@delay timer}: # 300 ticks = 15 seconds (adjust as needed)
set {{@world}_timer.%loop-player%} to {{@world}_timer.%loop-player%} + 1
if {{@world}_timer.%loop-player%} is greater than or equal to {@damage frequency}: # Adjust the value '20' to increase or decrease the damage frequency
damage loop-player by {@damage amount}
set {{@world}_timer.%loop-player%} to 0
else:
set {{@world}_timer.%loop-player%} to 0
else:
set {{@world}_entry_timer.%loop-player%} to 0
if {@World damage} is false:
stop
Posted by: madtrent. from the skUnity Discord. View the thread on skUnity Discord here