I've got a gate that I want to move. Simple enough, but I want the gate to move down 17 studs from its current position.
local gatepos = game.Workspace.Model.gate.gate1.Position.Y - 17
while game.Workspace.Model.gate.gate1.Position.Y ~= gatepos do
wait()
game.Workspace.Model.gate:TranslateBy(Vector3.new(0,-.1,0))
end
Now the script works fine, only it doesn't stop 17 studs down. It keeps going.
- I've checked the positions, they're correct.
- I've tried using other parts, no cigar.
- I've tried changing it to an entire vector3 value:
local y = game.Workspace.Model.gate.gate1.Position.Y - 17
local x = game.Workspace.Model.gate.gate1.Position.X
local z = game.Workspace.Model.gate.gate1.Position.Z
while game.Workspace.Model.gate.gate1.Position.Y ~= Vector3.new(x,y,z) do
wait()
game.Workspace.Model.gate:TranslateBy(Vector3.new(0,-.1,0))
end
Yet the script doesn't want to work.
Any and all help is appreciated. The script is taking surprisingly longer to make than I'd like.

1 comment
Thanks! Thanks for the advice as well. A 'for' loop is much more efficient.