Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make my group kick script not kick a certain person in the group that gets kicked?

game:GetService("Players").PlayerAdded:Connect(function(plr)
   if plr:IsInGroup(GroupID) then do -- nubs
       plr:Kick("Noob")
   end
   end
end)

2 answers

✓ Accepted answer

Check the userId, if its not the userid you want to whitelist, then kick them, or make a table , you choose

with a unique user id

game:GetService("Players").PlayerAdded:Connect(function(plr)
   if plr:IsInGroup(GroupID) then do -- nubs
if plr.UserId ~= (whitelistedUserId) then
       plr:Kick("Noob")
end
   end
   end
end)

with a table

local Whitelisted = {} -- put the user ids
game:GetService("Players").PlayerAdded:Connect(function(plr)
   if plr:IsInGroup(GroupID) then do -- nubs
if not Whitelisted[plr.UserId] then 
       plr:Kick("Noob")
end
   end
   end
end)

If this helps please mark this as answered, it would help very much!

1 comment

0

Thank you

Your code seems alright, you just have to replace the GroupID with ID of that group that can be found on the link when you get on group page.

1 comment

0

Also, if you mean to kick them if theyre not in a group, then do if (not plr:IsInGroup(groupid goes here))then plyr:Kick()

This discussion is preserved as it was. New answers, comments, and votes are closed.