Hello,
I want to detect if my game has Teams, but its not working!
i hope Someone can helps me.
local Rollen = {}
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
print(game.Teams:GetTeams())
if game.Teams:GetTeams() == {} then
warn("Keine Team's Gefunden!")
else
if table.find(Rollen, player.Team.Name) == true then
script.Parent:Sit(player.Character:FindFirstChild("Humanoid"))
elseif Rollen == nil then
script.Parent:Sit(player.Character:FindFirstChild("Humanoid"))
end
end
end)
First thing, please use :GetService("Teams") !! game:GetService([InsertServiceName]) will always be the best option for a myriad of reasons.
Second thing, all you have to do is:
if #game:GetService("Teams"):GetTeams() == 0 then
...
end
Mariogg also brings up something to know for the future, {} == {} will never be true, so don’t rely on it.