Ill keep this short
Basically either my script is broken or the Team system is bugged.
local players = game:GetService("Players")
local Team = game:GetService("Teams")
--Teams
local aa = Instance.new("Team", Team)
aa.Name = "1"
aa.AutoAssignable = true
local ab = Instance.new("Team", Team)
ab.Name = "2"
ab.AutoAssignable = true
local team_Select = {
[1] = aa,
[2] = ab
}
function randomplayer()
local plrs = players:GetChildren()
local do_math = math.random(1, #plrs)
local team_math = math.random(1, #team_Select)
for i, v in pairs(plrs) do
if i == do_math then
if workspace:FindFirstChild(v.Name) then
local team = players.LocalPlayer.Team.Team == team_math
end
break
end
end
end
players.PlayerAdded:Connect(function(player)
randomplayer()
end)
(when I refer to “aa” and “ab” I referring to the team variables.)
This script above simply creates teams and randomly puts the player in one of the teams. However only Team One (aa) is showed on the leaderboard. If I check explorer, both teams are there. If I remove the team I’m currently in (aa), then I will be in Team Two (ab).
Video below shows the issue :