Moving Part

Moving Part

Where to put this script

Inside the part you want to move

Script

Can be modified for x, y or z dimension

Bounds can be adjusted the > and < signs

wait() can be adjusted for speed


local part = script.Parent

local dir = 1

while true do
    part.Position = part.Position + Vector3.new(1*dir,0,0)
    wait(.1)

    if (part.Position.X > 100) then 
        dir = -1
    end

    if (part.Position.X < -100) then
        dir = 1
    end
end