Try this:
garagedoor = script.Parent.Parent
wait(5)
x = garagedoor.Position.X
z = garagedoor.Position.Z
while true do
local y = garagedoor.Position.Y
garagedoor.Position = Vector3.new(x, y + 0.01 ,z)
wait(0.01)
end
So the problem with your script was that you were adding 0.05 to y, but y never changed because you stored the garagedoor's original position in y, not it's current position.
So let's say y was 10. Then every time the loop went through, the new position of the garagedoor would be 10.05. Then the next loop it'd still be 10.05, and the next one it'd be 10.05..... you see the problem? y is always going to be 10, so that means we're going to have to change y to it's current position, not it's original position.
For this I put y in the loop, so it's always going to be the garage door's current position, so if it is 10.05, then the next time it would be 10.1, then 10.15...
I also changed the values slightly. The smoother you want the brick to move, the less time you should put in the wait(), (0.01 is the smallest). The slower you want to brick to move the less you add to y.
You can always change these values to your liking, it's whatever you want the brick to move.
2 comments
shouldnt you use a repeat until loop?
That would work too, but usually repeat until loops are used if they want to stop the brick from moving if something happens. I think he just wants the brick to move forever though.