• Get all player except Admins and Superadmins
    2 replies, posted
Hi, i'm beggining in lua and I am making a script wich kick all player with a chat command issued by a super admin. All is working very well, Superadmin can choose kick reason etc. But now I wanted to kick every player except admins but I dont understand how it is possible, I tried with an : [CODE]for _, v in pairs(player.GetAll()) do if (v:IsSuperAdmin() == 1 || v:IsAdmin() == 1)then ply:ChatPrint("You were not Kicked by /kall.") else v:Kick( Reason ) end end[/CODE] Thx for your help.
IsAdmin returns a bool, not a number? [editline]5th July 2016[/editline] Also, IsAdmin returns true if the player is a superadmin, so you don't really need the extra check
Thx for the tips but even like that, I'm still being kicked as Superadmin : [CODE]for _, v in pairs(player.GetAll()) do if (v:IsAdmin() == 1)then ply:ChatPrint("You were not Kicked by /kall.") else v:Kick( Reason ) end[/CODE] Edit : forgot to change 1 by true, thanks you for your help it is working now
Sorry, you need to Log In to post a reply to this thread.