I am trying to make a skript that when a player dies it activates a storm for 1hr.

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

javierconchab

Member
Jan 1, 2024
2
0
1
The problem I found is that I can't find a way to make it so that if a player has already died and there is already an hour in the counter and another one dies, another hour is added instead of starting from zero.

Code:
on death of player:
  send title "&c&l&o¡BALTIDEATH!" to all players
  send subtitle "%victim% murió por weon" to all players
  send message "&l&cDebido a la muerte de &4%victim% &cse avecinan dias de intensa tormenta, suerte en su cruzada por Baltideath..." to all players
  command "minecraft:weather thunder 3600s"

I am on version 1.20.1 of minecraft and the latest version of skript.
 
Code:
on death of player:   
    add 10 to {_deathtrain}
    
    send all players title "&c&l&o¡BALTIDEATH!" with subtitle "%victim% murió por weon" for 3 seconds with 1 second fade in and 1 second fade out
    send message "&l&cDebido a la muerte de &4%victim% &cse avecinan dias de intensa tormenta, suerte en su cruzada por Baltideath..." to all players
    console command "minecraft:weather thunder"
    console command "minecraft:gamerule doWeatherCycle false"
    
    function stormHandler():
        if {_storm} equals to {_deathtrain}:
            wait "%{_storm}% seconds" parsed as timespan
            console command "/minecraft:weather clear"
            console command "minecraft:gamerule doWeatherCycle true"
        else
            wait "%{_storm}% seconds" parsed as timespan
            trigger:
                stormHandler()
    
    set {_storm} to {_deathtrain}
    trigger:
        stormHandler()
 
The problem I found is that I can't find a way to make it so that if a player has already died and there is already an hour in the counter and another one dies, another hour is added instead of starting from zero.

Code:
on death of player:
  send title "&c&l&o¡BALTIDEATH!" to all players
  send subtitle "%victim% murió por weon" to all players
  send message "&l&cDebido a la muerte de &4%victim% &cse avecinan dias de intensa tormenta, suerte en su cruzada por Baltideath..." to all players
  command "minecraft:weather thunder 3600s"

I am on version 1.20.1 of minecraft and the latest version of skript.
The way I would code this is using a global variable. I would check on the player's death, see if the variable is set. If it is, then the storm will start for an hour, if not; nothing happens. After an hour, the variable would be cleared (Same time the storm would end, however you may want it to be two hours so there aren't constant storms).