I don't know why I can't do this.
local team = game:GetService("Teams")
local players = game:GetService("Players")
for i,v in pairs(players) do
print(v.team)
end
I don't know why I can't do this.
local team = game:GetService("Teams")
local players = game:GetService("Players")
for i,v in pairs(players) do
print(v.team)
end
I think it's because u need to get the players from the players service just like that:
local team = game:GetService("Teams")
local players = game:GetService("Players")
for i,v in pairs(players:GetPlayers()) do
print(v.team)
end
I think there are some more problems, but I don't know how to solve them or if I'm wrong and there aren't. I hope this fixed the problem.
thanks Bro, your right :)
local team = game:GetService("Teams")
local players = game:GetService("Players")
while true do
wait(.5)
for i,v in pairs(players:GetPlayers()) do
print(v.team)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Accessing the team property for a Player instance is
player.Team, orv.Teamin this case.