Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this Gui not appear to the certain players I put in the script?

I'm trying to make an Admin Gui but the script is not making the gui appear it is in a local script so I don't see whats wrong with it.

local player = game.Players.LocalPlayer

if player.Name == {"MasonTheCreeperYT3", "tfishy5"} then
	player.PlayerGui.AdminPanel.Gui = true
else
	player.PlayerGui.AdminPanel.Gui = false
end

1 answer

✓ Accepted answer

You're not checking whether the player is an admin correctly. You must a for loop to check though every name in array and see if the player's name is the admin's name. And, to enable a gui, you must use the Visible property of the GuiObject; not using itself

local player = game.Players.LocalPlayer
local admins = {
	"MasonTheCreeperYT3", 
	"tfishy5"
}

for i,v in pairs(admins) do
	if player.Name == v then
		player.PlayerGui.AdminPanel.Gui.Visible = true
	else
		player.PlayerGui.AdminPanel.Gui.Visible = false
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.