I need help with elevator and car

how do i make this:robloxapp-20200811-2019020.wmv (1.8 MB) not happen??

here is the code
up button :local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.down
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position + Vector3.new(0,i,0)
wait(0.4)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
script.Parent.Position = script.Parent.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

down button :local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.up
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
script.Parent.Position = script.Parent.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)
emergency button: local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent.Parent.down
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.up
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button.Position = button.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

I think you need to give some more info, code perhaps?

here is the code
up button :local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.down
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position + Vector3.new(0,i,0)
wait(0.4)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
script.Parent.Position = script.Parent.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position + Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

down button :local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.up
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
script.Parent.Position = script.Parent.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)
emergency button: local elevator = script.Parent.Parent.elevatorpart
local button = script.Parent.Parent.down
local clickdetector = script.Parent.ClickDetector
local button2 = script.Parent.Parent.up
local buttonstand = script.Parent.Parent.buttonstand

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1.7, goal, 0.1 do
elevator.Position = elevator.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button.Position = button.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
button2.Position = button2.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

clickdetector.MouseClick:Connect(function()
local goal = 2.3
for i = 1, goal, 0.1 do
buttonstand.Position = buttonstand.Position - Vector3.new(0,i,0)
wait(0.1)–Time
end
end)

1 Like

If you want to make a Smooth Elevator

You should use TweenService

1 Like