I have this rubbish, inefficient script I made that makes a model go UP. How would I make a more efficient type, that moves 5 studs in 5 seconds?
function DoorOpen()
script.Parent.Parent.DoTTAlarm.Button1.ClickDetector.MaxActivationDistance = 0
wait(.1)
script.Parent.Parent.DoTTAlarm.Button1.BrickColor = BrickColor.new(21)
wait(2)
script.Parent.Parent.DoTTAlarm.Alarm.Sound:Play()
wait(5)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,0.5,0))
wait(30) --CHECKPOINT
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(1)
script.Parent:TranslateBy(Vector3.new(0,-0.5,0))
wait(3)
script.Parent.Parent.DoTTAlarm.Button1.BrickColor = BrickColor.new(28)
wait(1)
script.Parent.Parent.DoTTAlarm.Button1.ClickDetector.MaxActivationDistance = 10
wait(1)
script.Parent.Parent.DoTTAlarm.Alarm.Sound:Stop()
end
script.Parent.Parent.DoTTAlarm.Button1.ClickDetector.MouseClick:connect(DoorOpen)

1 comment
Also, to make the object go to other way, set the "-sidespeed" to "sidespeed" and "sidespeed" to "-sidespeed".