- Code:
b = script.Parent
floor = script.Floor
floor.Value = 0
pos0 = b.Position
pos1 = game.Workspace.Brick1.Position
pos2 = game.Workspace.Brick2.Position
Table = {pos0,pos1,pos2}
while true do
wait()
projectposition = Table[floor.Value + 1]
if projectposition == b.Position then
--b.BodyVelocity.velocity = Vector3.new(0,0,0)
script.dir.Value = 0
end
if script.dir.Value == 0 then
b.BodyVelocity.velocity = Vector3.new(0,0,0)
elseif script.dir.Value == 1 then
b.BodyVelocity.velocity = Vector3.new(0,10,0)
elseif script.dir.Value == 2 then
b.BodyVelocity.velocity = Vector3.new(0,-10,0)
end
end
Is there anything theoretically wrong with this script? Please note dir and Floor are NumValues inside this script, and methods to change these are not included.