So I have this small little script that if you are in a group, it kicks you, but I want to make it so it checks multiple groups, and if you are in one of them, you get kicked, how would I do this?\
local Players = game:GetService("Players")
groupId = 0;
function onPlayerAdd(player)
local rank = player:GetRankInGroup(groupId)
if (player:IsInGroup(groupId)) then
player:Kick("You have been kicked from the game")
else
player:Kick("You have been kicked from the game")
end
end
Players.PlayerAdded:connect(onPlayerAdd);
local groupIds = {}
function playerInGroup(plr)
for _, groupId in pairs(groupIds) then
if plr:IsInGroup(groupId) then
return true
end
end
return false
end
What you need to understand is that you will get exploiters in your game (even when banning these groups) instead of blocking the issue from joining, stop the issue from causing a problem (write your code with security in mind)