Need help with spawn "cooldown"

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

ZushiYum

Member
Apr 5, 2025
3
0
1
So I want to make it so when a player spawns/respawns they have the slowness effect (or cant move both work) and the blindness effect for 10 seconds with a displayed cooldown on their screen to show when they will spawn, if anyone can help or make something for me I would be really grateful (I couldn't figure it out :emoji_frowning: )
 
I believe this will work! (sorry if this is not optimized I'm new to skript)
code_language.skript:
on respawn:
    add 10 to {respawncooldown::%player's uuid%}
    loop 11 times:
        wait 1 second
        apply potion of blindness of tier 255 without any particles to player for 100 seconds
        apply potion of slowness of tier 255 without any particles to player for 100 seconds
        send action bar "&4Time left&r&f: %{respawncooldown::%player's uuid%}%" to player
        remove 1 from {respawncooldown::%player's uuid%}
        if {respawncooldown::%player's uuid%} = -1:
            wait 1 tick
            send action bar "&4Time left&r&f: &60" to player
            delete {respawncooldown::%player's uuid%}
            remove blindness from player
            remove slowness from player
 
I believe this will work! (sorry if this is not optimized I'm new to skript)
code_language.skript:
on respawn:
    add 10 to {respawncooldown::%player's uuid%}
    loop 11 times:
        wait 1 second
        apply potion of blindness of tier 255 without any particles to player for 100 seconds
        apply potion of slowness of tier 255 without any particles to player for 100 seconds
        send action bar "&4Time left&r&f: %{respawncooldown::%player's uuid%}%" to player
        remove 1 from {respawncooldown::%player's uuid%}
        if {respawncooldown::%player's uuid%} = -1:
            wait 1 tick
            send action bar "&4Time left&r&f: &60" to player
            delete {respawncooldown::%player's uuid%}
            remove blindness from player
            remove slowness from player
thank you so much!!
 
made it so the player cannot move at all when in the respawn delay and added a little optimization.
Code:
on respawn:
    set {respawncooldown::%player's uuid%} to 10
    set {stoped::%player's uuid%} to true
    apply potion of blindness of tier 255 without any particles to player for 11 seconds

    while {respawncooldown::%player's uuid%} > 0:
        send action bar "&4Time left&r&f: &c%{respawncooldown::%player's uuid%}%" to player
        wait 1 second
        remove 1 from {respawncooldown::%player's uuid%}
    send action bar "&4Time left&r&f: &60" to player
    delete {respawncooldown::%player's uuid%}
    set {stoped::%player's uuid%} to false
    remove blindness from player

on player move:
    if {stoped::%player's uuid%} is true:
        cancel event

on player jump:
    if {stoped::%player's uuid%} is true:
        cancel event