I'm trying to set up a system to check to see if the user is an admin and if they are they are given the admin panel that I have made.
Here's the code Ps its in the ServerScriptService if that matters at all
-- Give Admin Panel function
local Admins = {"Bosskiller177", "Test 2"}
local function checkPlayerForAdmin(plr)
local adminPanel = game:GetService("StarterGui")["Admin Panel"] -- Gets the Admin Panel
for index = 1, #Admins do
if Admins[index] == plr then
print("Admin")
adminPanel.Enabled = true
break
else
print("Not Admin")
adminPanel.Enabled = false
end
end
end
game.Players.PlayerAdded:Connect(function(plr)
checkPlayerForAdmin(plr)
end)
I've looked all over but the results are either to complex for me or just doesn't work Why is lua being like this, any other language ive learnt makes this process so easy, but not with lua
