Discord Thread if a player has a item on their head

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
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

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
 
I'm sorry, but I can't quite grasp what you're looking for
Why have you sent a code with 'every 1 tick' if you need it to work on /hat?
Maybe try to split your sentence into points, like:
- Every second player gets damaged if:
- player is in world 'test'
- player is wearing a specific player head

Since right now I'm not sure what you need.

Posted by: madpancake from the skUnity Discord.
 
whats up man
the point of this skript is that if a player is in the moon world {@world} they will staft taking damage after 300 ticks {@delay timer} but if they are wearing a player head with the {@helmet1.enchantment} {@helmet1.enchantlvl} enchantnts and if the name of the playerhead is "{@helmet1.name}" then they will not take damage in the {@world} but if they take the helmet off then they will take damage again.
i think i figerd it out tho i just said
code_language.skript:
                if loop-player's helmet is a player head:
                    if loop-player's helmet is enchanted with {@helmet1.enchantment} {@helmet1.enchantlvl}:
                        set {_helmet1Name} to name of loop-player's helmet
                        if {_helmet1Name} is "{@helmet1.name}":
                            stop
and it seens to work

Posted by: madtrent. from the skUnity Discord.
 
Status
Not open for further replies.