I am making a team change GUI and me and my friend want it so that only me and him can see a specific button to join a specific team while allowing everyone to see the other buttons for other teams, I know how to make it change the players team, I just need to know how to make it is so that if the players name is equal to the "eligible" players list name, then a button will be visible.
Here's an example code of what I mean:
local EligiblePlayers = {"thesavagery212", "Sinx_Clair"}
local plr = script.Parent.Parent.Parent.Parent.Parent.Name
if plr == EligiblePlayers then
script.Parent.Visible = false else
script.Parent.Visible = true
end
Sorry I am not the best coder.

1 comment
This should fix it for you.
local EligiblePlayers = {"name", "Sinx_Clair"} local plr = game.Players.LocalPlayer.Name for i,v in pairs(EligiblePlayers) do if not plr.Name == v then script.Parent:Destroy() -- Destroying is more secure than turning off visibility. else script.Parent.Visible = true end end