Help with group locked door

  1. What do you want to achieve? Making a group rank locked door

  2. What is the issue? The door won’t open and there’s no errors

  3. What solutions have you tried so far? I looked on the developer forum but nothing seems to solve my problem

script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		if plr:GetRankInGroup(15934671) >= 11 then
			script.Parent = false
			wait(2)
			script.Parent = true
		end
	end
end)
3 Likes

Add print statements after the event fires, as well as both of your if statements to see if the code is even running. Also, make sure the Group Id is correct.

1 Like

The group id is correct And the code is running but I’m not sure why it didn’t open.

I’m assuming this is the issue:

script.Parent = false/true

Try changing your script to:

script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		if plr:GetRankInGroup(15934671) >= 11 then
			script.Parent.CanCollide = false
			wait(2)
			script.Parent.CanCollide = true
		end
	end
end)

It doesn’t work either the print, It doesn’t show up of anything.

Are you there? I’ll get fired from this experience if I don’t get this working

Ok so you said that the prints don’t work anymore? Can you specify which ones work and which ones don’t?

nevermind tried a another script and it works

1 Like

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