I wanted to make a admin script but i failed and i need more help in this one.
The script i used:
local admins = {
require(script.Parent.Settings).Ranks
}
function IsAdmin(player)
for _,Admin in pairs(admins) do
if Admin:lower() == player:lower() then
return true
end
end
return false
end
game.Players.PlayerAdded:Connect(function(Player)
if IsAdmin(Player) then
local ui = script.AdminGUI:Clone()
ui.Parent = Player.PlayerGui
elseif script.AdminGUI:Clone().Parent == Player.PlayerGui and not IsAdmin(Player) then
Player:Kick("Reason: \n Exploiting to AdminScreen. \n Kicked By System")
end
end)
Someone told to me that the elseif part is wrong and im trying to correct that part.
If you want to help, please tell in the comments your opinions or scripts!
also i will change the name to UserID because userids cant be changed
but i need to change the function to work but do i need to still use string.lower?
Yes, I made a mistake because my square brain saw local ui = script.AdminGUI:Clone() and didn’t see script.AdminGUI:Clone().Parent. I said to change that to the latter in my last post.