Hello, Can Anyone Help On My Script. Im Trying To Make Specific Users Unkickable. Heres My Script (Script Is On ServerScriptService)
For More Information: Im Making A Admin Panel With A Kick Script.. But I Want Admins To Be Unable To Be Kicked.
game.ReplicatedStorage.KickPlayer.OnServerEvent:connect(function(player, playerToKick, reason)
local Info = {}
Info.Whitelist = {
["test"] = true,
["test2"] = true
}
function Info:AdminP(player)
if Info.Whitelist[player.name] then
return true
else
return false
end
end
local Player = game.Players.LocalPlayer
if Info:AdminP(Player) then
print(playerToKick.." Is A Admin Player, You Cannot Kick.")
else
game.Players:FindFirstChild(playerToKick):Kick("Kicked! Reason: "..reason.." - Kicked By: "..player.Name)
end
end)

1 comment
It's not "more secure", it's just more efficient; the UserId is a statically unique identifier.