Im trying to make it so that if the player is an admin, the gui wouldnt be visible to them. I can't seem to find the problem though...
Thanks in advance
Admins = {['sweetlittlegirlohhl'] = true if Admins script.Parent.Parent.Visible = false end end?)
then
. You also did not close off your dictionary correctly, and there is a random end?)
.local Admins = { ['sweetlittlegirlohhl'] = true } if Admins[Player.Name] then -- remember to define Player script.Parent.Parent.Visible = false end
You have many sensible mistakes, but no worries. I got your back.
game.Players.PlayerAdded:connect(function(plr) -- When the player enters, the below code is ran. Admins = {"user", "user", "user"} -- Make sure to edit the "user" entries to a username for i,values in pairs(admin) do if plr.Name == values then script.Parent.Parent.Visible = false end end end)
This is untested, if there is an error, please look in the output and let me know about it.
If you care to read, I'll explain what the code does.
The first line says that when the player enters the game the code inside of it is executed.
The second line is essential and will define any users that should be admin.
The fourth line defines the table's values individually inside of a if loop so that it is ran by the number of values the variable, Admins contains.
The sixth line simply turns the object invisible.