When player equips an iron helmet it isn't giving water breathing

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

  • LOOKING FOR A VERSION OF SKRIPT?

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

Status
Not open for further replies.

nep nep

Member
May 1, 2021
1
0
1
23
The error says can't understand this event: 'every 1 second in world'

Code:
every 1 second in world:
    if slot 39 of player is iron helmet:
        apply water breathing to player for 999 days
    if slot 39 of player is air:
        remove water breathing from player
 
The error says can't understand this event: 'every 1 second in world'

Code:
every 1 second in world:
    if slot 39 of player is iron helmet:
        apply water breathing to player for 999 days
    if slot 39 of player is air:
        remove water breathing from player


use this
Code:
every 20 ticks in "world":
    loop all players:
        if slot 39 of loop-player's inventory is iron helmet:
            apply water breathing to loop-player for 1 day
        if slot 39 of loop-player's inventory is air:
            remove water breathing from loop-player

note * this could be laggy depending on how many people are in your server


also i changed a bit of your code because when i fixed the first issue there were more issues with it so i fixed them too :emoji_slight_smile:
 
Last edited:
If you have installed SkBee, i would recommand this https://skripthub.net/docs/?id=4139 instead of the periodic loop

im so dumb xD.
butttt you dont have to have skBee installed for that.

Code:
on player armor change:
  if event-item is Iron Helmet:
    apply water breathing to player for 9999 days
  if event-item isn't Iron Helmet:
    remove water breathing from player
^ this doesnt use skBee
 
Last edited:
Status
Not open for further replies.