#How to send message to all players in a variable ?
1 messages · Page 1 of 1 (latest)
there can only be one thing in a variable
u might wanna use lists
and u can just send message to the list of players
oo i just wanna create a team, and send message to all players in that team !
hmm how can i add a minigame start timer ? means when someone joins a minigame lobby there will be a 10 second countdown , then they will be teleported to the corresponding spawns
permission: game.start
trigger:
send "&aStarting the game..." to player
loop all players:
chance of 50%:
add loop-player to {team1::*}
send "&fYou joined the &cRed&f team." to loop-player
continue
chance of 50%:
add loop-player to {team2::*}
send "&fYou joined the &9Blue&f team." to loop-player
continue
send "&fWelcome to the &cRed &fteam." to {team1::*}
send "&fWelcome to the &9Blue &fteam." to {team2::*}
command /endgame:
permission: game.end
trigger:
delete {team1::*} and {team2::*}
broadcast "&fThe game has ended."```
Please read over the code to understand it. The most important thing of it is when you save players to a list, its saved like `player1 and player2 and player3` so it would be the same as doing `send "hi" to player1 and player2 and player3`. I also use continue in the loop to tell the skript to continue to the next player when picking teams. I hope this helped you, and hope your game goes well : )
🥣