I want to allow certain people that may not yet meet the requirements in the group or may not be in the group to get through without being kicked. I wasn’t able to find a successful way that would allow me to do this and it would just kick anyone who touched the part.
I have tried to search up a solution on how I could do this on google but haven’t found any videos/articles on how I could fix this.
Here is the script that I currently have that was kicking everyone that touched the part.
local plr = game.Players.LocalPlayer
local GarageDivider = game.workspace.ZZZ
GarageDivider.Touched:Connect(function(hit)
if hit.Parent.Name == plr.Name then
if plr:GetRankInGroup(123456) <= 223 or if plr.UserId ~= 123456789 or 987654321 then
plr:Kick("You do not have permission to enter this area.")
end
end
end)
