Hello, so I am making a elevator lift. I’m not sure why this isn’t working.
– Variables
local isSurface = true
local elevator = script.Parent
local surfaceControl = script.Parent.ElevatorSurfaceControl
local mainControl = script.Parent.ElevatorControl
local entranceControl = script.Parent.ElevatorEntranceControl
– Main Code
mainControl.Down.ProximityPrompt.Triggered:Connect(function(down)
repeat
elevator.PrimaryPart.Position = elevator.PrimaryPart.Position = Vector3.new(0,-1,0)
wait(0.1)
until elevator.PrimaryPart.Position == Vector3.new(-55.869, -150, -646.045)
end)
I’m trying to change the position of the elevator until reaches -55.869, -150, -646.045.
local isSurface = true
local elevator = script.Parent
local surfaceControl = script.Parent.ElevatorSurfaceControl
local mainControl = script.Parent.ElevatorControl
local entranceControl = script.Parent.ElevatorEntranceControl
– Main Code
mainControl.Down.ProximityPrompt.Triggered:Connect(function(down)
repeat
elevator.PrimaryPart:PivotTo(CFrame.new(-55.869, -150, -646.045))
wait(0.1)
until elevator.PrimaryPart.CFrame == CFrame.new(-55.869, -150, -646.045)
end)
I’m moving the primary part in the elevator. I also have the primary part set.
Okay. When I used :PivotTo, it just disappears. I don’t even know where it went.
I set the numbers to the models origin position where I want it to go. It didn’t even go there. Also, is there a way to make it slowly move because I want the player to be able to stand on it, it’s a elevator lift.