Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a one-way door? [SOLVED]

Asked by 10 years ago

I have a game where you're not supposed to be able to enter the hallway you last entered, and I would like to implement a one-way can-collide brick. Is there any way to do that?

2 answers

Log in to vote
1
Answered by 10 years ago

Make an invisible brick in front of the entrance that the player walks through to activate the door. Then, have nothing to open the door on the other side. Basically, put no scripts in the door and put it in the invisible brick.

Ad
Log in to vote
0
Answered by 10 years ago

put

door = script.Parent

function onTouch(hit)
    if hit.Parent == nil then return end
    local h = hit.Parent:FindFirstChild("Humanoid")
    if h ~= nil then
        hit.Parent.Torso.Velocity=door.CFrame.lookVector * 10000
    end
end
door.Touched:connect(onTouch)

in door you can change 10000 to the force of the vector

0
The door flung me away on either side.. DrCylonide 158 — 10y
0
Then you reduce the Velocity on line 7 Maxomega3 106 — 10y
0
Still. The door flung be on either side.. If the door has to be cancollide = false, then this is a very weak door. Players who lag can walk through. Nickoakz 231 — 10y

Answer this question