Solved on death of player in {stw::*}

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

saad3modeyy

Member
Mar 14, 2020
24
0
0
25
Code:
if arg-1 is "join":
            if arg-2 is "1":
            if {stw.players.1} is not set:
                set {stw.players.1} to 1
                set {stw.queue.1.%player%} to 1
                set {stw.game.1} to true
                set {stw::*} to player
                teleport player to {stw.lobby.1}
                send "{@prefix} &7you joined the queue!&6 %{stw.players.1}%&6/4" to player

how I can make a code that on death of 1 player in {stw::*} set the die player for spectator mode

"{stw::*} is group of 4 players"

MINECRAFT SPIGOT: 1.12
SKRIPT: 2.5-alpha2
 
Last edited:
Code:
command /stw <text> <text>:
    trigger:
        if arg-1 is "setspawn":
            if arg-2 is "1":
                clear {stw.spawn.1}
                set {stw.spawn.1} to location of the player
                send "{@prefix} &7Spawn now set at &6%{stw.spawn.1}%" to player
        if arg-1 is "removespawn":
            if arg-2 is "1":
                clear {stw.spawn.1}
                send "{@prefix} &7Spawn is now removed &6%arg 2%" to player       
        if arg-1 is "setlobby":
            if arg-2 is "1":
                set {stw.lobby.1} to location of the player
                send "{@prefix} &7Lobby now set at &6%{stw.lobby.1}%" to player
        if arg-1 is "removelobby":
            if arg-2 is "1":
                clear {stw.lobby.1}
                send "{@prefix} &7Lobby is now removed &6%arg 2%" to player
        if arg-1 is "list":
            send "%{stw::*}% to player"
        if arg-1 is "start":
            if arg-2 is "1":
                if {stw.game.1} is true:
                    loop all players:
                        if {stw::*} is set:
                            teleport player to {stw.spawn.1}
                            apply blindness of tier 3 without any particles to the loop-player for 15 seconds
                            give wooden hoe named "&7&lWooden Rifle" to loop-player
                            give iron sword named "&8&lPocket Knife" to loop-player
                            give blaze powder named "&6&lMagic blaze powder" to loop-player
                            set {stw.game.1.time} to true
                            set {stw.chat.off} to true
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&8&oYou're wondering why you're here." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oThe world has been destroyed by strange creatures." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oPeople call it zombies." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oIt's a serious epidemic that has spread from animals to humans" to {stw::*}
                            send "&8&oand we've been observing it for a while." to {stw::*}
                            send "&7" to {stw::*}
                            wait 45 ticks
                            send "&8&oBut we couldn't control it, and it started to spread. " to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oNow it's your turn to stop him and save the world." to {stw::*}
                            send "&7" to {stw::*}
                            set {stw.chat.off} to false
      if arg-1 is "join":
            if arg-2 is "1":
            if {stw.players.1} is not set:
                set {stw.players.1} to 1
                set {stw.queue.1.%player%} to 1
                set {stw.game.1} to true
                set {stw::*} to player
                teleport player to {stw.lobby.1}
                send "{@prefix} &7you joined the queue!&6 %{stw.players.1}%&6/4" to player
            else:
                if {stw.queue.1.%player%} is 1:
                    send "{@prefix} &7you are already in the game!" to player
                else:
                    if {stw.players.1} is 4:
                        send "{@prefix} &7Too Lateee! The game has already started." to player
                    else:
                        if {stw.players.1} is less than 4:
                            set {stw.queue.1.%player%} to 1
                            add 1 to {stw.players.1}
                            teleport player to {stw.lobby.1}
                            send "{@prefix} &7you joined the queue! &6 %{stw.players.1}%&6/4" to player
                        else:
                            if {stw.players.1} is less than 5:
                                set {stw.queue.1.%player%} to 1
                                add 1 to {stw.players.1}
                                teleport player to {stw.lobby.1}
                                send "{@prefix} &7you joined the queue! &6 %{stw.players.1}%&6/4" to player
                                set {stw.game.1} to true
                                teleport {stw::*} to {stw.spawn.1}
        if arg-1 is "clear":
            if arg-2 is "1":
                clear {stw.spawn.1}
                clear {stw.lobby.1}
                clear {stw.players.1}
                clear {stw.queue.1.%player%}
                clear {stw::*}
                send "&6Cleared" to player

on chat:
  if {stw.chat.off} is true:
    cancel event
 
Code:
command /stw <text> <text>:
    trigger:
        if arg-1 is "setspawn":
            if arg-2 is "1":
                clear {stw.spawn.1}
                set {stw.spawn.1} to location of the player
                send "{@prefix} &7Spawn now set at &6%{stw.spawn.1}%" to player
        if arg-1 is "removespawn":
            if arg-2 is "1":
                clear {stw.spawn.1}
                send "{@prefix} &7Spawn is now removed &6%arg 2%" to player      
        if arg-1 is "setlobby":
            if arg-2 is "1":
                set {stw.lobby.1} to location of the player
                send "{@prefix} &7Lobby now set at &6%{stw.lobby.1}%" to player
        if arg-1 is "removelobby":
            if arg-2 is "1":
                clear {stw.lobby.1}
                send "{@prefix} &7Lobby is now removed &6%arg 2%" to player
        if arg-1 is "list":
            send "%{stw::*}% to player"
        if arg-1 is "start":
            if arg-2 is "1":
                if {stw.game.1} is true:
                    loop all players:
                        if {stw::*} is set:
                            teleport player to {stw.spawn.1}
                            apply blindness of tier 3 without any particles to the loop-player for 15 seconds
                            give wooden hoe named "&7&lWooden Rifle" to loop-player
                            give iron sword named "&8&lPocket Knife" to loop-player
                            give blaze powder named "&6&lMagic blaze powder" to loop-player
                            set {stw.game.1.time} to true
                            set {stw.chat.off} to true
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&7" to {stw::*}
                            send "&8&oYou're wondering why you're here." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oThe world has been destroyed by strange creatures." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oPeople call it zombies." to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oIt's a serious epidemic that has spread from animals to humans" to {stw::*}
                            send "&8&oand we've been observing it for a while." to {stw::*}
                            send "&7" to {stw::*}
                            wait 45 ticks
                            send "&8&oBut we couldn't control it, and it started to spread. " to {stw::*}
                            send "&7" to {stw::*}
                            wait 40 ticks
                            send "&8&oNow it's your turn to stop him and save the world." to {stw::*}
                            send "&7" to {stw::*}
                            set {stw.chat.off} to false
      if arg-1 is "join":
            if arg-2 is "1":
            if {stw.players.1} is not set:
                set {stw.players.1} to 1
                set {stw.queue.1.%player%} to 1
                set {stw.game.1} to true
                set {stw::*} to player
                teleport player to {stw.lobby.1}
                send "{@prefix} &7you joined the queue!&6 %{stw.players.1}%&6/4" to player
            else:
                if {stw.queue.1.%player%} is 1:
                    send "{@prefix} &7you are already in the game!" to player
                else:
                    if {stw.players.1} is 4:
                        send "{@prefix} &7Too Lateee! The game has already started." to player
                    else:
                        if {stw.players.1} is less than 4:
                            set {stw.queue.1.%player%} to 1
                            add 1 to {stw.players.1}
                            teleport player to {stw.lobby.1}
                            send "{@prefix} &7you joined the queue! &6 %{stw.players.1}%&6/4" to player
                        else:
                            if {stw.players.1} is less than 5:
                                set {stw.queue.1.%player%} to 1
                                add 1 to {stw.players.1}
                                teleport player to {stw.lobby.1}
                                send "{@prefix} &7you joined the queue! &6 %{stw.players.1}%&6/4" to player
                                set {stw.game.1} to true
                                teleport {stw::*} to {stw.spawn.1}
        if arg-1 is "clear":
            if arg-2 is "1":
                clear {stw.spawn.1}
                clear {stw.lobby.1}
                clear {stw.players.1}
                clear {stw.queue.1.%player%}
                clear {stw::*}
                send "&6Cleared" to player

on chat:
  if {stw.chat.off} is true:
    cancel event
Code:
if arg-1 is "join":
    if arg-2 is "1":
        if {stw.players.1} is not set:
            set {stw.players.1} to 1
            set {stw.queue.1.%player%} to 1
            set {stw.game.1} to true
            set {stw::%uuid of player%} to player
            teleport player to {stw.lobby.1}
            send "{@prefix} &7you joined the queue!&6 %{stw.players.1}%&6/4" to player


on death:
    if {stw::%uuid of player%} is set:
        set gamemode of player to spectator
 
[02:09:39 ERROR]: Unexpected entry 'if arg-1 is "join"'. Check whether it's spelled correctly or remove it. (ranks.sk, line 140: if arg-1 is "join":')
[02:09:39 WARN]: Possible name conflict of variables {stw::%uuid of player%} and {stw::*} (there might be more conflicts). (ranks.sk, line 184: if {stw::%uuid of player%} is set:')
 
Status
Not open for further replies.