Solved everyone except player

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

Flash

New Member
Jun 2, 2020
5
1
3
28
Hey, i've been trying to create multiple commands like /tpall or /killall or /kickall, but I dont want it to affect the one sending the command, how can I do that ?
 
Hey, i've been trying to create multiple commands like /tpall or /killall or /kickall, but I dont want it to affect the one sending the command, how can I do that ?
i made this skript in 1 minute so i don't know if it works correctly, i think yes cuz i see no errors on it

take this as example
Code:
loop all players:
    loop-player is not %target%:
        #do stuff

Code:
command /tpall [<offlineplayer>]:
    permission message: &cYou have no permissions.
    permissions: rank.admin
    executable by: players
    trigger:
        if arg-1 is not set:
            if number of all players >= 2:
                loop all players:
                    if loop-player is not player:
                        teleport loop-player to player
                        send "&eYou were teleported to &6%player%." to loop-player
                    send "&aAll players have been teleported to you."
            else:
                send "&cNo players to teleport to your location."
        else:
            if arg-1 is online:
                if number of all players >= 2:
                    loop all players:
                        if loop-player is not arg-1:
                            teleport loop-player to arg-1
                            send "&eYou were teleported to &6%arg-1%." to loop-player
                    send "&eAll players have been teleported to you." to arg-1
            else:
                send "&cNo player matching &e%arg-1% &cis connected to this server."
 
  • loop all players:
  • if loop-player is not player:

i made this skript in 1 minute so i don't know if it works correctly, i think yes cuz i see no errors on it

take this as example
Code:
loop all players:
    loop-player is not %target%:
        #do stuff

Code:
command /tpall [<offlineplayer>]:
    permission message: &cYou have no permissions.
    permissions: rank.admin
    executable by: players
    trigger:
        if arg-1 is not set:
            if number of all players >= 2:
                loop all players:
                    if loop-player is not player:
                        teleport loop-player to player
                        send "&eYou were teleported to &6%player%." to loop-player
                    send "&aAll players have been teleported to you."
            else:
                send "&cNo players to teleport to your location."
        else:
            if arg-1 is online:
                if number of all players >= 2:
                    loop all players:
                        if loop-player is not arg-1:
                            teleport loop-player to arg-1
                            send "&eYou were teleported to &6%arg-1%." to loop-player
                    send "&eAll players have been teleported to you." to arg-1
            else:
                send "&cNo player matching &e%arg-1% &cis connected to this server."
thanks, im gonna try it :emoji_grinning:
[doublepost=1591254337,1591253587][/doublepost]
thanks, im gonna try it :emoji_grinning:
So, it works perfectly , I tried that on /killall it works but when I add "spawn loop-player" it doesn't respawn them :/
[doublepost=1591254408][/doublepost]
Code:
command /killall:
    permission: skript.killall
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    trigger:
        loop all players in player's world:
            loop-player is not player:
                loop-player is not "FastAs_Flash":
                    kill loop-player
                    send "[&6Flash's Server&r] &4Killed all players in your world !"
                    send "[&6Flash's Server&r] &4You were killed by %player%" to loop-player
                    wait 2 ticks
                    spawn loop-player
 
  • Like
Reactions: Dave
thanks, im gonna try it :emoji_grinning:
[doublepost=1591254337,1591253587][/doublepost]
So, it works perfectly , I tried that on /killall it works but when I add "spawn loop-player" it doesn't respawn them :/
[doublepost=1591254408][/doublepost]
Code:
command /killall:
    permission: skript.killall
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    trigger:
        loop all players in player's world:
            loop-player is not player:
                loop-player is not "FastAs_Flash":
                    kill loop-player
                    send "[&6Flash's Server&r] &4Killed all players in your world !"
                    send "[&6Flash's Server&r] &4You were killed by %player%" to loop-player
                    wait 2 ticks
                    spawn loop-player
You have to set the spawnpoint with another command and then teleport all players
Code:
command /setspawn [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.setspawn
    usage: /setspawn
    trigger:
        if arg-1 is not set:
            set {spawn} to player's location
            send "&aYou've set the spawnpoint at &f%{spawn}%&a."
        else:
            send "Unknown command."

command /spawn [<offlineplayer>] [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.spawn
    executable by: players
    usage: /spawn <player>
    trigger:
        if arg-1 is not set:
            if arg-2 is not set:
                teleport player to {spawn}
                send "&aYou've teleported to spawn."
            else:
                send "Unknown command."
        else:
            if arg-2 is not set:
                if arg-1 is online:
                    teleport arg-1 to {spawn}
                    send "&aYou've teleported &e%arg-1% &ato spawn."
                    send "&aYou were teleported to spawn." to arg-1
                else:
                    send "&cNo player matching &e%arg-1% &cis connected to this server."
            else:
                send "Unknown command."

command /killall [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.killall
    usage: /killall
    trigger:
        if arg-1 is not set:
            loop all players in player's world:
                loop-player is not player or "FastAs_Flash":
                    kill loop-player
                    heal loop-player #to prevent death title bug
                    teleport loop-player to {spawn}
                    send "[&6Flash's Server&r] &4You were killed by %player%" to loop-player
                send "[&6Flash's Server&r] &4Killed all players in your world !"
        else:
            send "Unknown command."
You can also use something like ''on join'' event.
Code:
on join:
    teleport player to {spawn}
 
You have to set the spawnpoint with another command and then teleport all players
Code:
command /setspawn [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.setspawn
    usage: /setspawn
    trigger:
        if arg-1 is not set:
            set {spawn} to player's location
            send "&aYou've set the spawnpoint at &f%{spawn}%&a."
        else:
            send "Unknown command."

command /spawn [<offlineplayer>] [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.spawn
    executable by: players
    usage: /spawn <player>
    trigger:
        if arg-1 is not set:
            if arg-2 is not set:
                teleport player to {spawn}
                send "&aYou've teleported to spawn."
            else:
                send "Unknown command."
        else:
            if arg-2 is not set:
                if arg-1 is online:
                    teleport arg-1 to {spawn}
                    send "&aYou've teleported &e%arg-1% &ato spawn."
                    send "&aYou were teleported to spawn." to arg-1
                else:
                    send "&cNo player matching &e%arg-1% &cis connected to this server."
            else:
                send "Unknown command."

command /killall [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.killall
    usage: /killall
    trigger:
        if arg-1 is not set:
            loop all players in player's world:
                loop-player is not player or "FastAs_Flash":
                    kill loop-player
                    heal loop-player #to prevent death title bug
                    teleport loop-player to {spawn}
                    send "[&6Flash's Server&r] &4You were killed by %player%" to loop-player
                send "[&6Flash's Server&r] &4Killed all players in your world !"
        else:
            send "Unknown command."
You can also use something like ''on join'' event.
Code:
on join:
    teleport player to {spawn}
nvm it was a /spawnpoint bug
 
nvm it was a /spawnpoint bug
ye, but ''spawn %players%'' doesn't works so u have to make one or also, use ''force %players% to respawn"
Code:
command /killall [<text>]:
    permission message: [&6Flash's Server&r] &cYou don't have permission to do that.
    permission: skript.killall
    usage: /killall
    trigger:
        if arg-1 is not set:
            loop all players in player's world:
                loop-player is not player or "FastAs_Flash":
                    kill loop-player
                    force loop-player to respawn
                    send "[&6Flash's Server&r] &4You were killed by %player%" to loop-player
                send "[&6Flash's Server&r] &4Killed all players in your world !"
        else:
            send "Unknown command."
 
Status
Not open for further replies.