i don't get any error in the output and the teams never show up.
admins={"Threatboy101","vinothpizza555"} game.Players.PlayerAdded:connect(function(player) if admins[player.Name]then player.Chatted:connect(function(msg) if string.sub(msg,1,6)==":Teams"then repeat wait() until teams ==game:GetService("Teams") -- A variable for teams blue =Instance.new("Team", teams) -- The new team blue.Name = "BLUE" -- The team's name is "Sup" red =Instance.new("Team", teams) red.Name="RED" print("yay") end end) end end)
This line:
if admins[player.Name]then
Returns the item in the table with the key, player.Name and not the item in the table with the value of, player.Name
You would instead need to loop through the table to find the value
local admins = {"Player1", "Player2"} function isAdmin(player) for index, value in pairs(admins) do if player.Name:lower() == value:lower() then return true end end end
Add that function into your script then replace the part that says:
if admins[player.Name]then
with
if isAdmin(player) then