make it so a command checks everyone

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

Pup_lboo

Member
Mar 15, 2022
13
0
1
23
when i use this code it gives the right gun to the player who did /start but everyone else gets a pistol only
Code:
command /start:
    cooldown : 1 minute
    cooldown message: "please wait to start"
    trigger:
        kill all arrows
        remove all arrow from player
        remove all diamond horse armor from players
        remove all golden horse armor from players
        remove all iron horse armor from players
        teleport all players to location (-16.7, 59, 5.3)
        wait 200 ticks
        give all players iron horse armor named "&7Pistol"
        player has permission "{ak}":
            wait 3 ticks
            give player golden horse armor named "&6Ak-47"
        player has permission "{op}":
            wait 3 ticks
            give player diamond horse armor named "&bShotGun"
        player has permission "{SR}":
            wait 3 ticks
            give player diamond horse armor named "&2Sniper Rifle"
 
I have seen people trying something like this. I am not good at loops I am trying to give you ideas. try looking for old loop players inside a variable to see if you find something for you.
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop {game_guns::*}:   
            give loop-player a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
 
says theres no loop that matches loop-player
i dont know hot to use loops so idk what how to fix
 
says theres no loop that matches loop-player
i dont know hot to use loops so idk what how to fix
try this instead
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop {game_guns::*}:
            give {game_guns::*} a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
or this
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop {game_guns::*}:
            give loop-value a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
 
says theres no loop that matches loop-player
i dont know hot to use loops so idk what how to fix
Also you can try this.
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop all players in {game_guns::*}:
            give loop-player a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
 
gives me a diamond sword but no one gets a iron sword
Check if the list contains players
Code:
Command /test:
    Trigger:
        Add player to {game_guns::*}
        Message "%{game_guns::*}%"
#if not try
Command /test:
    Trigger:
        Add "%player%" to {game_guns::*}
        Message "%{game_guns::*}%"
 
sends my name 4 times sends my friends name 1 time and send iron sword like 20 times
To clear the variable do delete {game_guns::*}
Let me see if I find how to give items to payers inside a list
 
Try this make sure to add players to {game_guns::*}
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop {game_guns::*}:
            give loop-index a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
 
says loop-index cant have anything added to it
Try this
Code:
command /join:
    trigger:
        add player to {game_guns::*}
        #to remove try remove player from {game_guns::*}
command /start:
    trigger:
        give a diamond sword to the player #This will give the item for the one who execute /start
        loop {game_guns::*}:
            give {game_guns::%loop-index%} a iron sword # This will give the sword to everyone inside {game::guns}
            #if the one who execute the command is inside remove the pistol from him if you want to
 
Status
Not open for further replies.