Hello people of the scripters, the script is kicking all the players, but I want it to make it so it only kicks the people that aren't in the group and arent the a lies. Please help as soon as possible!
local Players = game:GetService("Players")
local allies = {}
local groupID = 10248
local pages = game:GetService("GroupService"):GetAlliesAsync(groupID)
while true do
for _,group in pairs(pages:GetCurrentPage()) do
table.insert(allies, group)
end
if pages.IsFinished then
break
end
pages:AdvanceToNextPageAsync()
end
function OnPlayerAdded(player)
for _,group in pairs(allies) do
if not player:IsInGroup(group.Id) then
player:kick()
else
print("player is fear and is good")
end
end
end
Players.PlayerAdded:connect(OnPlayerAdded)
for _,player in pairs(Players:GetPlayers()) do
OnPlayerAdded(player)
end
