while true do wait() if script.Parent.Control.Value == 1 then for i= 1,20 do script.Parent.A1.A1.Mesh.Offset = script.Parent.A1.A1.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A2.Mesh.Offset = script.Parent.A1.A2.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A3.Mesh.Offset = script.Parent.A1.A3.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A4.Mesh.Offset = script.Parent.A1.A4.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A5.Mesh.Offset = script.Parent.A1.A5.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A6.Mesh.Offset = script.Parent.A1.A6.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B1.Mesh.Offset = script.Parent.A1.B1.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B2.Mesh.Offset = script.Parent.A1.B2.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B3.Mesh.Offset = script.Parent.A1.B3.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B4.Mesh.Offset = script.Parent.A1.B4.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B5.Mesh.Offset = script.Parent.A1.B5.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B6.Mesh.Offset = script.Parent.A1.B6.Mesh.Offset + Vector3.new(0.3,0,0) wait(0) script.Parent.A1.A1.CanCollide = false script.Parent.A1.A2.CanCollide = false script.Parent.A1.A3.CanCollide = false script.Parent.A1.A4.CanCollide = false script.Parent.A1.A5.CanCollide = false script.Parent.A1.A6.CanCollide = false script.Parent.A1.B1.CanCollide = false script.Parent.A1.B2.CanCollide = false script.Parent.A1.B3.CanCollide = false script.Parent.A1.B4.CanCollide = false script.Parent.A1.B5.CanCollide = false script.Parent.A1.B6.CanCollide = false script.Parent.Control.Value = 1.1 end if script.Parent.Control.Value == 2 then for i= 1,20 do script.Parent.A1.A1.Mesh.Offset = script.Parent.A1.A1.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A2.Mesh.Offset = script.Parent.A1.A2.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A3.Mesh.Offset = script.Parent.A1.A3.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A4.Mesh.Offset = script.Parent.A1.A4.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A5.Mesh.Offset = script.Parent.A1.A5.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A6.Mesh.Offset = script.Parent.A1.A6.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B1.Mesh.Offset = script.Parent.A1.B1.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B2.Mesh.Offset = script.Parent.A1.B2.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B3.Mesh.Offset = script.Parent.A1.B3.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B4.Mesh.Offset = script.Parent.A1.B4.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B5.Mesh.Offset = script.Parent.A1.B5.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B6.Mesh.Offset = script.Parent.A1.B6.Mesh.Offset + Vector3.new(-0.3,0,0) wait(0) script.Parent.A1.A1.CanCollide = true script.Parent.A1.A2.CanCollide = true script.Parent.A1.A3.CanCollide = true script.Parent.A1.A4.CanCollide = true script.Parent.A1.A5.CanCollide = true script.Parent.A1.A6.CanCollide = true script.Parent.A1.B1.CanCollide = true script.Parent.A1.B2.CanCollide = true script.Parent.A1.B3.CanCollide = true script.Parent.A1.B4.CanCollide = true script.Parent.A1.B5.CanCollide = true script.Parent.A1.B6.CanCollide = true script.Parent.Control.Value = 2.1 end end end end
This Part is work
if script.Parent.Control.Value == 1 then for i= 1,20 do script.Parent.A1.A1.Mesh.Offset = script.Parent.A1.A1.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A2.Mesh.Offset = script.Parent.A1.A2.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A3.Mesh.Offset = script.Parent.A1.A3.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A4.Mesh.Offset = script.Parent.A1.A4.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A5.Mesh.Offset = script.Parent.A1.A5.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.A6.Mesh.Offset = script.Parent.A1.A6.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B1.Mesh.Offset = script.Parent.A1.B1.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B2.Mesh.Offset = script.Parent.A1.B2.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B3.Mesh.Offset = script.Parent.A1.B3.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B4.Mesh.Offset = script.Parent.A1.B4.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B5.Mesh.Offset = script.Parent.A1.B5.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B6.Mesh.Offset = script.Parent.A1.B6.Mesh.Offset + Vector3.new(0.3,0,0) wait(0) script.Parent.A1.A1.CanCollide = false script.Parent.A1.A2.CanCollide = false script.Parent.A1.A3.CanCollide = false script.Parent.A1.A4.CanCollide = false script.Parent.A1.A5.CanCollide = false script.Parent.A1.A6.CanCollide = false script.Parent.A1.B1.CanCollide = false script.Parent.A1.B2.CanCollide = false script.Parent.A1.B3.CanCollide = false script.Parent.A1.B4.CanCollide = false script.Parent.A1.B5.CanCollide = false script.Parent.A1.B6.CanCollide = false script.Parent.Control.Value = 1.1 end
But why this part is not work?
if script.Parent.Control.Value == 2 then for i= 1,20 do script.Parent.A1.A1.Mesh.Offset = script.Parent.A1.A1.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A2.Mesh.Offset = script.Parent.A1.A2.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A3.Mesh.Offset = script.Parent.A1.A3.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A4.Mesh.Offset = script.Parent.A1.A4.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A5.Mesh.Offset = script.Parent.A1.A5.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.A6.Mesh.Offset = script.Parent.A1.A6.Mesh.Offset + Vector3.new(0.3,0,0) script.Parent.A1.B1.Mesh.Offset = script.Parent.A1.B1.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B2.Mesh.Offset = script.Parent.A1.B2.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B3.Mesh.Offset = script.Parent.A1.B3.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B4.Mesh.Offset = script.Parent.A1.B4.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B5.Mesh.Offset = script.Parent.A1.B5.Mesh.Offset + Vector3.new(-0.3,0,0) script.Parent.A1.B6.Mesh.Offset = script.Parent.A1.B6.Mesh.Offset + Vector3.new(-0.3,0,0) wait(0) script.Parent.A1.A1.CanCollide = true script.Parent.A1.A2.CanCollide = true script.Parent.A1.A3.CanCollide = true script.Parent.A1.A4.CanCollide = true script.Parent.A1.A5.CanCollide = true script.Parent.A1.A6.CanCollide = true script.Parent.A1.B1.CanCollide = true script.Parent.A1.B2.CanCollide = true script.Parent.A1.B3.CanCollide = true script.Parent.A1.B4.CanCollide = true script.Parent.A1.B5.CanCollide = true script.Parent.A1.B6.CanCollide = true script.Parent.Control.Value = 2.1 end end end end
To be honest I couldn't read your code :/. Very messy so I went ahead and wrote it for you simpler and cleaner. (Less lines of code too!)
for ChangeMeshOffset, Makes the Offset be what you like it to be using Vector3
CC is the CanCollide, a boolean set to true and false
CV is the Control.Value set to what you like (1.1 or 2.1)
function ChangeMeshOffset(Offset, CC, CV) for i = 1, 20 do for index = 1, 6 do wait() script.Parent.A1["A" .. index].Mesh.Offset = script.Parent.A1["A" .. index].Mesh.Offset + Offset end for index = 1, 6 do wait() script.Parent.A1["B" .. index].Mesh.Offset = script.Parent.A1["B" .. index].Mesh.Offset + Offset end wait() for index = 1, 6 do wait() script.Parent.A1["A" .. index].CanCollide = CC end for index = 1, 6 do wait() script.Parent.A1["B" .. index].CanCollide = CC end script.Parent.Control.Value = CV end end while wait() do if script.Parent.Control.Value == 1 then ChangeMeshOffset(Vector3.new(-0.3,0,0), false, 1.1) elseif script.Parent.Control.Value == 2 then ChangeMeshOffset(Vector3.new(0.3,0,0), true, 2.1) end end