Thread:Pdgrobloxking/@comment-26919612-20150823114245

SquarePosLimit = 256

Height = 4

while true do

b = math.random(1,8)

if b == 1 then

for a = 1,30 do

script.Parent.CFrame = script.Parent.CFrame + Vector3.new (0.1,0,0)

wait(0.001)

end

elseif b == 2 then

for a = 1,30 do

script.Parent.CFrame = script.Parent.CFrame + Vector3.new (-0.1,0,0)

wait(0.001)

end

elseif b == 3 then

for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (0,0,0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">elseif b == 4 then

<p style="margin-top:0px;margin-bottom:0px;">for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (0,0,-0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">elseif b == 5 then

<p style="margin-top:0px;margin-bottom:0px;">for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (0.1,0,0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">elseif b == 6 then

<p style="margin-top:0px;margin-bottom:0px;">for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (-0.1,0,-0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">elseif b == 7 then

<p style="margin-top:0px;margin-bottom:0px;">for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (-0.1,0,0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">elseif b == 8 then

<p style="margin-top:0px;margin-bottom:0px;">for a = 1,30 do

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.CFrame = script.Parent.CFrame + Vector3.new (0.1,0,-0.1)

<p style="margin-top:0px;margin-bottom:0px;">wait(0.001)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">if script.Parent.Position.x >= SquarePosLimit then

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.Position = Vector3.new(0,Height,0)

<p style="margin-top:0px;margin-bottom:0px;">elseif script.Parent.Position.z >= SquarePosLimit then

<p style="margin-top:0px;margin-bottom:0px;">script.Parent.Position = Vector3.new(0,Height,0)

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;">end

<p style="margin-top:0px;margin-bottom:0px;"> <ac_metadata title="script moving part rondom place"> </ac_metadata>