So this script changes your team when you walk over the spawn location but I have it detect if the team is "StaffOnly" and then detect if you're an admin/staff but it doesn't seem to be working even if Player1 is on the Admin Table. I don't really know what I'm doing wrong.
local Admin = {"Player1","NextYearStudios"}
script.Parent.Touched:connect(function(part)
local character = part.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player.TeamColor == script.Parent.TeamColor then
return
else
for _,i in pairs (game.Teams:GetTeams()) do
if i.TeamColor == script.Parent.TeamColor then
if i.Folder_TeamStats.StaffOnly.Value == true then
if player.Name == Admin then
player.Team = i
else
return
end
elseif i.Folder_TeamStats.StaffOnly.Value == false then
player.Team = i
print(player.Team)
print(player.TeamColor)
end
end
end
end
end)

3 comments
You're comparing the player's name to the table 'Admin,' and incorrectly spelt 'Name' on line 12 (lua is case-sensitive.) :P
updated the error on line 12, and how would I make it filter through the admin table to see if the name is on the list?
Well, to simply create dictionaries is one way: http://wiki.roblox.com/index.php?title=Table#Dictionaries Literally lol.