helmet named condition

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

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

madtrent

Member
Jul 29, 2023
1
0
1
hello im trying to crate a skript for if they are in the moon world they take damage cand cant mine some blocks unless they are waring a spesific helmet.The skript loads and no erros but a player can ware any helmet and they can still mine blocks and dont take damage.


here is the stuff i have done

command /helmet [<text>]:
permission: op
trigger:
if arg-1 is "space1":
give player leather helmet named "&7&lMoon Space Helmet &bTier "
else:
if arg-1 is "space2":
give player leather helmet named "&e&lMoon Space Helmet &bTier [II]"
else:
if arg-1 is "space3":
give player leather helmet named "&4&lMoon Space Helmet &bTier [III]"





on join:
if {moon_timer.%player%} is not set:
set {moon_timer.%player%} to 0
if {moon_entry_timer.%player%} is not set:
set {moon_entry_timer.%player%} to 0

every 1 tick:
loop all players:
if world of loop-player is "Moon":
if loop-player is wearing a helmet named "&7&lMoon Space Helmet &bTier ":
stop trigger
if loop-player is wearing a helmet named "&e&lMoon Space Helmet &bTier [II]":
stop trigger
if loop-player is wearing a helmet named "&4&lMoon Space Helmet &bTier [III]":
stop trigger
set {moon_entry_timer.%loop-player%} to {moon_entry_timer.%loop-player%} + 1
if {moon_entry_timer.%loop-player%} is greater than or equal to 300: # 300 ticks = 15 seconds (adjust as needed)
set {moon_timer.%loop-player%} to {moon_timer.%loop-player%} + 1
if {moon_timer.%loop-player%} is greater than or equal to 20: # Adjust the value '20' to increase or decrease the damage frequency
damage loop-player by 1
set {moon_timer.%loop-player%} to 0
else:
set {moon_timer.%loop-player%} to 0
else:
set {moon_entry_timer.%loop-player%} to 0

on block break:
if world is "Moon":
if player is not wearing a helmet named "&4&lMoon Space Helmet &bTier [III]":
if event-block is ancient debris:
cancel event
else:
if event-block is diamond ore:
cancel event
else:
if event-block is iron ore:
cancel event
else:
if event-block is gold ore:
cancel event
else:
if event-block is redstone ore:
cancel event
else:
if event-block is lapis lazuli ore:
cancel event
else:
if event-block is coal ore:
cancel event



every 1 tick:
loop all players:
if world of loop-player is "Moon":
apply jump boost 3 without particles to loop-entity for 9999 seconds
apply slow falling 1 without particles to loop-entity for 9999 seconds
if world of loop-player is not "Moon":
remove jump boost from potion effects of loop-player
remove slow falling from potion effects of loop-player

every 1 tick:
loop all entities:
if world of loop-entity is "Moon":
if loop-entity is not a player:
apply jump boost 3 without particles to loop-entity for 9999 seconds
apply slow falling 1 without particles to loop-entity for 9999 seconds
 
Please format your code using a code-block.

1690661050392.png