Last time i asked, an admin closed my question. I am making an admin GUI for my game Fishing simulator. But the code i tried to use did not work and the error said "Players.Anotherperson_999.PlayerGui.ExplorerPropertiesGui.Script:2: 'then' expected near 'not'" Code: local admins = {"Anotherperson_999"} if game.Players.LocalPlayer.Name not in admins then script.Parent.Enabled = false end
✓ ANSWER ACCEPTED
I cant make a admin GUI and i need help from a better scripter. Anybody willing to help?
2 answers
✓ Accepted answer
I doubt your code would work with how you have it setup, I haven't seen a "not in" before (doubt it's even a thing)
Try
local player = game.Players.LocalPlayer
local admins = {"User1","User2"}
if not admins[player.Name] then --If player's name not in admins
script.Parent:Destroy() --Then remove ScreenGUI
else --If player's name is in admins
wait() --Then do nothing
end
This, on the other hand should work. Put it in a local script right inside the ScreenGUI.
1 comment
0
Thank you so much.
I don't entirely know what you're trying to accomplish, but I think I might have a solution. You can try using the script:
game.Players.PlayerAdded:Connect(function(player)
if player.Name == "UserNameHere" then
script.Parent.Value = false
end
end)
This might not be the solution you want, but it is a solution. I'm not sure if "if player.Name == "UserNameHere" or "OtherUserName" then" would work.
-Frumos
This discussion is preserved as it was. New answers, comments, and votes are closed.

8 comments
I dont think you can use "in" like that, i may be wrong
if not admins[name] then ...
Before you try and jump ahead, start learning all of the programming fundamentals, Roblox Wiki has some really good tutorials you can start looking at to begin with on their main page.
I closed a question of yours earlier today. Might you please review our help articles at https://scriptinghelpers.org/help and review our purposes and what we do at https://scriptinghelpers.org/about . Thank you.
Please use Code Brackets.
You should keep the UI in ServerStorage since an exploiter could do script.parent.Enabled = true without problems.
@JaykeRU, it's not necessarily the problem with an exploiter enabling a GUI on the client side, it's a developer's fault if they do not do any verification or authentication of if the person is an admin on the server side.
^