Ok so I need the gui to only be activated if the players name is Plieax but when I play my game on another account the if statement still runs allowing the non-admin player admin abilities. How do I fix this?
game.Players.PlayerAdded:connect (function(plr) if plr.Name == "Plieax" or "" or "" then -- Put Names Of Admins Between The ""s -- plr.PlayerGui:WaitForChild "OpenAdmin".Enabled = true end end)
It would help if you used a table to save the admins names and used a function to check and see if they are a admin. Here is an example:
local adminList = {"Plieax", "Bob", "Joe"} -- names are examples function checkIfPlayerIsAdmin(player) -- will equal false if the player is not an admin for i,v in pairs(adminList) do if v == player.Name then return true end end return false end game.Players.PlayerAdded:connect(function(player) if checkIfPlayerIsAdmin(player) then -- Put your code in here end end)
game.Players.PlayerAdded:Connect(function(plr) if plr.Name == "Plieax" then plr.PlayerGui:WaitForChild "OpenAdmin".Enabled = true end end)