For example, there are 12 players in a game. 2 are admins and the others are normal players. I want to give access to admins to like, for example, change the team of the 5 players to blue and the other 5 players to red. I want to give access to admins to add more teams, too. Oh, by the way, I want to put this in a GUI.
COMMUNITY QUESTION
How to give a certain player access to change other players' teams?
1 answer
To Give Access To Only Admins You Can Do
local admins = {"RazorXX2", "OTHERUSER"}
local player = game.Players.LocalPlayer
if player.name == admins then
script.parent.visible = true -- make sure it is a local script and script is inside gui frame
end
to make admins make teams you can do
script.Parent.MouseButton1Click:Connect(function()
local newteam = Instance.new("Team")
newteam.Parent = Teams
newteam.Name = " NAME"
end)
i wont answer more as this isnt a request site
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
the script is not even correct, you need to use a pairs loop and loop through the table and see if one of the player matches with the table corresponding value, it's not valid to see if a player name is equal to a table
you should never trust the client with any important data because exploiters can easily manipulate it, and that includes the names of admins