Personally I would use PlayerGui. PlayerGui is local and only is visible to the client.
(Tip use UserId instead of the Player Name)
if game.Players.LocalPlayer.Name == "BrokenGri","MyBigFreak","Wy588" then
player.PlayerGui.GuiNameHere.Enabled = true
else
player.PlayerGui.GuiNameHere.Enabled = false
end
If this was done for the conditional statement to return true for multiple player names, then it won’t work for the purpose - try using tables instead
local player = game.Players.LocalPlayer
if table.find({"player1", "player2"}, player.Name) then
--// stuff
end
I’m assuming this is a LocalScript, make checks like these on the server unless you want people to be able to bypass them.
I suggest you put the gui under serverstorage and when player joins, make a server script to check if it’s the good name. If it is, clone the gui and put it in the player gui since if it’s in StarterGui, exploiters could easy enable/disable it.
Try this and remember to put it in ServerScriptService:
local GUI = game.StarterGui -- Gui
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player.Name == "BrokenGri" or "MyBigFreak" or "Wy588" then
GUI.Enabled = true
else
GUI.Enabled = false
end
end)
end)
This won’t work how you think by the way, due to how that keyword works if the player’s name isn’t the first value (“BrokenGri”) then the code in that block will always run since strings (and anything other than false and nil) are truthy values, to do what you probably meant:
local name = player.Name
if name == "BrokenGri" or name == "MyBigFreak" or name == "Wy588" then
end
not how it works
local var = 1
local cond = var == 2, 1, 3 -->> false, because it'll only compare against the first value (the one before any commas)
even using or with the commas won’t work as expected.
That’s why if u have a admin GUI Before u execute the command whatever u do another for i,v in pairs loop looping through the table to see if the name is good or not.