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

How Do You Use Operators On CFrame?

Asked by 10 years ago

Hey guys, I'm making a door that's supposed to go into a wall via CFrame. Please do not post 'Why don't you just use BodyVelocity, Aurum?' or something completely irrelevant. I should be able to fix up Door 2 when I know how to work Door 1. Thanks. This is my failed script:

Sensor1 = script.Parent.Sensors.Sensor1
Sensor2 = script.Parent.Sensors.Sensor2
Door1 = script.Parent.Doors.Door1
Door2 = script.Parent.Doors.Door2

Sensor2.Touched:connect(function (hit)
    if not hit.Parent:FindFirstChild("Humanoid") then return end
    repeat
        local e = Door1.Position
        Door1.Position = e - CFrame.new(0,0,.01)
        wait(.01)
    until Door1.Position == Vector3.new(94.2, 18.2, 79.3)
end)

Any idea what's wrong with it?

0
Output? fireboltofdeath 635 — 10y
0
Surely you'd be able to see something without the output, which only says disconnected due to exception... SquirreIOnToast 309 — 10y
0
Hnnn, I could try. HexC3D 830 — 10y

Answer this question