Hi guys! I have a scripting problem, that I can’t solve, so I want you guys to give me some help. So basically my game is a team game, and I made two teams.
After making two teams, I added an “IntValue” both of them:
It works fine. I set the MaxPlayer_red value to 25, and the MaxPlayer_blue value to 1.
My problem is that I cant figure out how to make a system that sorts out from all of the players (max 26 on server), just 1 player, and after selecting just ONLY ONE player, the system will put him to the Blue team, and the match/round begins.
Sorry for my bad english. And thanks all for your help! Bye, have a great day!
I would call this function whenever your match begins, it should select someone randomly and put them on the blue team
function choosePlayer()
local Player = game.Players:GetPlayers()[math.random(#game.Players:GetPlayers())]
--print(Player), for debugging if you want
Player.TeamColor = game.Teams.Blue.TeamColor
end