So I'm working on this right here;
local conveyors = script.Parent.conveyors:GetChildren()
repeat wait() until active.Value == true
print('debug')
conveyors.Velocity = script.Parent.CFrame.lookVector *2
wait()
First thing; this code only runs once when active is true even though it's supposed to run forever until active is false, I just want this code to go through if active is true and stop the loop if active is false.
Another thing I want to make this conveyor section only work with one script instead of 1 in each part, how would I do that? I'm assuming it's GetChildren but whenever I run it I get CFrame is not a valid member of Model.

11 comments
How do I do conveyor.Velocity = conveyor.CFrame.lookVector *0 all in the same function, I'm a bit braindead at the moment.
Conveyors is a table containing all your your Conveyor parts. When you loop through it using the for loop I used, it will go through every single conveyor. You'll affect all of the conveyors with just a few lines of code.
I can't do if active.Value == false then, so what would be a placeholder for that?
What do you mean? The if statement won't run if active is false, and the conveyors will not be activated.
I know but I want to deactivate the conveyors when active is false or else it will run forever.
Yeah, that's the point. Each time the loop wait()s, it checks if active is true. If it is true, it will apply the force to each conveyor. If it is false, it does not apply the force, and effectively deactivates them.
You sure because it doesn't do the same for me.
Oh, really? Let me redo my answer if that isn't the case... I'll add an else statement.
Done again, check it out
oh duh, else
Thanks!