Events Help needed

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

Julius Ohly

Member
Mar 20, 2021
19
0
1
23
Im trying to use the following skript on my minehut server:

on player death:
trigger:
make player gamemode spectator
wait 1 tick
show title "You Died! Respawning in 3..." to player
wait 10000000 ticks
show title "You Died! Respawning in 2..." to player
wait 10000000 ticks
show title "You Died! Respawning in 1..." to player
wait 10000000 ticks
make player gamemode survival
teleport player to -112 11 -26

But every time i reload, it says all code has to be put in triggers...
i have no idea what to do because clearly its all in triggers...
 
Im trying to use the following skript on my minehut server:

on player death:
trigger:
make player gamemode spectator
wait 1 tick
show title "You Died! Respawning in 3..." to player
wait 10000000 ticks
show title "You Died! Respawning in 2..." to player
wait 10000000 ticks
show title "You Died! Respawning in 1..." to player
wait 10000000 ticks
make player gamemode survival
teleport player to -112 11 -26

But every time i reload, it says all code has to be put in triggers...
i have no idea what to do because clearly its all in triggers...
So... uhh.... well...
1) 10000000 ticks is a long time... a long long time... you can use seconds or minutes if you want to.
2) you dont use "trigger" with events like this, only with commands
3) Here's your fix:
Code:
on death:
    victim is player
    set player's gamemode to spectator
    wait 1 tick
    send title "You Died! Respawning in 3..." to player
    wait 1 second
    send title "You Died! Respawning in 2..." to player
    wait 1 second
    send title "You Died! Respawning in 1..." to player
    wait 1 second
    set player's gamemode to survival
    teleport player to location at -112, 11, -26
 
Thank you so much!
it got the part with spectator mode working, but the title isnt showing...
it didnt say any errors tho, do you have any idea how to fix this?
[doublepost=1619177069,1619168393][/doublepost]oh wait

just checked it out again and it works!
Huge thank you!
 
Status
Not open for further replies.