I was makin’ that elevator the other day, I was able to make it work and stuff, I just have a hard time figurin’ out how long does the ride take in the followin’ script:
local Elevator = script.Parent
while true do
wait(15)
for i = 1,100 do
Elevator:TranslateBy(Vector3.new(0,-1,0))
wait()
end
wait(2)
for i = 1,100 do
Elevator:TranslateBy(Vector3.new(0,1,0))
wait()
end
end
The idea is that by the begginin’ of the game, the elevator waits 15 seconds before goin’ down, and by the end of the ride down it waits 2 seconds, to come back again. The question is HOW LONG does the ride take?
local initial = tick()
local Elevator = script.Parent
while true do
wait(15)
for i = 1,100 do
Elevator:TranslateBy(Vector3.new(0,-1,0))
wait()
end
wait(2)
for i = 1,100 do
Elevator:TranslateBy(Vector3.new(0,1,0))
wait()
end
end
print(tick()-initial) -- Prints out the total time it took since initial was declared