You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
i want the script to pick players from lobby team, and not all players
- What is the issue? Include screenshots / videos if possible!
well, it takes all players in the game
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
well, i tried some stuff, but it didn’t work. i also searched solution on the internet (i am bad at scripting) also looked on Developer Hub
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this script picks players and puts them in teams red/blue. also there is a lobby team. i need it to take players from lobby team
-- amount of players in each team
local BlueTeamCount
local RedTeamCount
-- amoungt of remaining players at the end of the round (and after round has started)
local remainingBlue
local remainingRed
inRound.Changed:Connect(function()
if inRound.Value == true then
BlueTeamCount = {}
RedTeamCount = {}
for i, plr in pairs(plrs:GetChildren()) do -- i tried changing this
local char = plr.Character
local humanRoot = char:WaitForChild("HumanoidRootPart")
local allPlrs = plrs:GetChildren()
-- will put the current player into a team with the less amount of players
if #RedTeamCount > #BlueTeamCount then
plr.Team = blueTeam
humanRoot.CFrame = game.Workspace.BlueSpawn.CFrame
table.insert(BlueTeamCount, plr.Name)
print(plr.Name .. " put in ".. plr.Team.Name)
elseif #BlueTeamCount > #RedTeamCount then
plr.Team = redTeam
humanRoot.CFrame = game.Workspace.RedSpawn.CFrame
table.insert(RedTeamCount, plr.Name)
print(plr.Name .. " put in ".. plr.Team.Name)
math.random
i hope its a right topic, anything would be helpful
i am not so smart enough to figure it out, also just noticed my grammar-