#Revive all

1 messages · Page 1 of 1 (latest)

half pecan
#

How do i make a command to revive all players at the same time?

#
    if {p::*} does not contain uuid of player:
        add uuid of player to {p::*}
        
        set {lives::%uuid of player%} to 3

on death:
    if victim is a player:
        remove 1 from {lives::%uuid of victim%}    
        if {lives::%uuid of victim%} <= 0:
            broadcast "&c&l%victim%&c&l was eliminated!"    
          
            add uuid of victim to {dead::*}

command /revive [<offline player>]:
    trigger:
        if player has permission "lives.revive":
            if arg-1 is set:
                if {dead::*} contains uuid of arg-1:
                    remove uuid of arg-1 from {dead::*}
                    
                    unban arg-1
                    
                    broadcast "&a&lREVIVE: &b%arg-1% &7Has been revived!"
                else:
                    send "&cThis player is not dead!" to player
            else:
                send "&cSpecify a player!" to player
        else:
            send "&cYou cannot do this!" to player
            stop```
deep kiln
#

loop {dead::*} and revive them

half pecan
#

thx i'll try

#
    trigger:
        if player has permission "lives.revive":
            loop {dead::*}
            
                    broadcast "&a&lREVIVE: &b%arg-1% &7Has been revived!"
                else::
            send "&cYou cannot do this!" to player```
#

?

#

why don't it work

deep kiln
#

u need a colon after loop {dead::*} and why dont ur broadcast line have indents

half pecan
deep kiln
#

whats the else: line for

ruby thunder
# half pecan

you need to correctly indent your else at the same line as your if is

velvet wind
#
    trigger:
        if player has permission "lives.revive":
            loop {dead::*}
            
                    broadcast "&a&lREVIVE: &b%arg-1% &7Has been revived!"
                else::
            send "&cYou cannot do this!" to player``` in this you aren't removing the loop-player's uuid from {dead::*} or unbanning the loop-player and there is no colon also the indentation
dire tiger
#

You could save a line and indent by using on death of player

dire tiger
velvet wind
dire tiger
#

Ah