descreetOP
(descreetOP)
December 11, 2022, 1:49pm
1
I wanted to know how to change team to all players in the server, i have this script:
player.Team = game.Teams.Lobby
print("changed player.team to Lobby")
And i get player with this script:
game.Players.PlayerAdded:Connect(function(plr)
Does not work because player is the last player to join the server?
1 Like
kArmag0re
(KarmaXX)
December 11, 2022, 1:52pm
2
you can do the following:
local player = game.Players:GetChildren()
for i = 1,#player do
player[i].Team = game.Teams. Lobby
print("Changed "..player[i].Name.." Team to Lobby")
end
1 Like
Or you can do this a similar way that is more understandable for beginners:
for _,player in pairs(game.Players:GetPlayers()) do
player.Team = game.Teams.Lobby
print("Changed "..player.Name.."'s team to Lobby.")
end
1 Like
system
(system)
Closed
December 25, 2022, 2:07pm
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.