Log in to vote
0

How do I make this door?

Asked by 7 years ago

I am making a place for the group: C&G Council I want to make a door which only allows this group to pass, but I want to be able to allow players who aren't in this group pass through the door if I press a certain button.

So basically, I will have a control room with buttons (parts you can click) and one of those buttons to do what I mentioned above.

1 answer

Log in to vote
0
Answered by 7 years ago

you could use the :IsInGroup() method like this

door = script.Parent
door.Touched:connect(function(prt)
if prt.Parent and game.Players:GetPlayerFromCharacter(prt.Parent) and game.Players:GetPlayerFromCharacter(prt.Parent) :IsInGroup(132707) then
door.CanCollide = false
wait(5)
door.CanCollide = true
end)

and in another script you could have it connect to a ClickDetector to open the door for all users

Ad

Answer this question