I am using CollectionService to have my conveyor belt script in one spot, And where I learned how to use the CollectionService I looked at the comments because my original code was not working and somebody said for while loops to use coroutines. But since I have not touched coroutines until now I'm not sure how to fix this script. I was reading the coroutine API reference but I can't seem to figure out how to make this work correctly. Any help would be appreciated.
local CollectionService = game:GetService("CollectionService")
local function makeBelt(part)
part.Velocity = part.CFrame.lookVector * 15
wait()
end
for _, Part in pairs(CollectionService:GetTagged("Belt")) do
print(Part)
local Coroutine = coroutine.create(makeBelt(Part))
coroutine.resume(Coroutine)
end
Forgot to add that this is the error I get in the output: "missing argument #1 to 'create' (function expected)"

1 comment
Thank you!