I have no clue how to do it and was experimenting so see if it will work. My script doesn't work, and I am sure most of it doesn't exist. Here is my code.
script.Parent.Visible = false local Admins = {"Sadwowow21"} if Player.name == Admins then script.Parent.Visible = true end
So what I would do is create a Dictionary (which is basically an array but each index [or value] is assigned a value).
Let me demonstrate:
local Player = game.Players.LocalPlayer; local dictionary = { Admin1 = true, Admin2 = true }; print(dictionary["Admin1"]); -- true
Why this is better is because now, you can set different people to have different "staff" levels.
local Player = game.Players.LocalPlayer; local dictionary = { Username1 = "Administrator", Username2 = "Moderator" }; print(dictionary["Username1"]); -- "Administrator"
So, how do you implement this into your script?
local Player = game.Players.LocalPlayer; script.Parent.Visible = false; local Admins = { Sadwowow21 = true, -- Add more names, and set them to true }; if Admins[Player.Name] then script.Parent.Visible = true; end
If you further wanted to add more and have it only show for Administrators:
local Player = game.Players.LocalPlayer; script.Parent.Visible = false; local Admins = { Sadwowow21 = "Administrator", TestUser = "Moderator" -- Add more names, and set them to true }; if Admins[Player.Name] == "Administrator" then -- Even though TestUser is in the dictionary, they are ignored because they are set as a "Moderator" and not an "Administrator", which is what we looked for with this line. script.Parent.Visible = true; end
You are trying to compare a string with a table, what you actually want to do is get the strings in the table like so
script.Parent.Visible = false local Admins = {"Sadwowow21"} for _, Admin in pairs(Admins) do if Player.Name == Admin then script.Parent.Visible = true end end
Note: Using the UserID is probably better for this