Group rank door

When a high rank goes threw the door it opens to everyone…
I’d like it to close and even if a high rank is “going threw” the door, a low rank cannot go threw. Here is my current script:

local doorpart = script.Parent -- Put the part acting as the door here
local id = 34046669 -- Put your group id here
local minimumRankLevel = 42 -- Put your desired minimum rank level here

doorpart.Touched:Connect(function(touchPart)
	if touchPart.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:FindFirstChild(touchPart.Parent.Name)
		if plr:IsInGroup(id) and plr:GetRankInGroup(id) >= minimumRankLevel then
			doorpart.CanCollide = false
		end
	end
end)
1 Like

Maybe make the script a local script ? if it isn’t already.

ok i’ll try and i’ll tell you.

1 Like

Nope. The local script doesn’t even allow users to pass threw…

1 Like

Changed category to Development Support.

The issue with this is clear, canCollide is set to false, then not returned to true.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.