I need help I tried to make an auto team script but everytime they get set onto the wrong team. Can you tell me what I did wrong?
Great regards, Luigi.
local Teams = game:GetService("Teams") game.Players.PlayerAdded:connect(function(plr) if plr.Name == "luigicrafter2" then plr.Team = Teams.Owner elseif plr.Name == "Greticrafter2" then plr.Team = Teams.CoOwner elseif plr.Name == "OrangenFeuer44" or "2014patrick" or "luigicrafter4" then plr.Team = Teams.Staff else plr.Team = Teams.Player end end)
If you use or, you must re-add the thing that you are checking, otherwise if it is just the string it'll always be true.
local Teams = game:GetService("Teams") game.Players.PlayerAdded:connect(function(plr) if plr.Name == "luigicrafter2" then plr.Team = Teams.Owner elseif plr.Name == "Greticrafter2" then plr.Team = Teams.CoOwner elseif plr.Name == "OrangenFeuer44" or plr.Name == "2014patrick" or plr.Name == "luigicrafter4" then plr.Team = Teams.Staff else plr.Team = Teams.Player end end)