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
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.
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