Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

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

2 answers

Log in to vote
0
Answered by 5 years ago

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!

0
Thank you XxMystical_SecretsxX 2 — 5y
Ad
Log in to vote
0
Answered by
karlo_tr10 1233 Moderation Voter
5 years ago

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.

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() royaltoe 5144 — 5y

Answer this question