I’m trying to make a script where if you are the member role in the group, you will be kicked from the game. But the issue I’m having is that if I set it to the member rank, higher ranks will be kicked as well and I don’t want that. Here’s the script:
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(REDACTED) >= 1 then
plr:Kick()
end
end)
Right now you only have it set so that any ranks above the member role will be kicked. You need to make a second condition that limits the higher ranks. You can achieve this by doing this:
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(REDACTED) >= 1 and plr:GetRankInGroup(REDACTED) <= 200 then
plr:Kick()
end
end)
200 is the rank in which you want the script NOT TO KICK beyond that. You can change that to your liking
local HigherRank = 200 -- Change This to the Higher Rank Boundary
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(REDACTED) <= HigherRank then
plr:Kick()
end
end)
Oh wait, scratch that, I see why. I added an equals sign after the less than inequality, which makes it “less than or equal to.” That was my silly mistake. Try this instead.
local HigherRank = 200 -- Change This to the Higher Rank Boundary
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(REDACTED) < HigherRank then
plr:Kick()
end
end)