Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Whats the more efficient way of having 100's of conveyors?

Asked by
dirk2999 103
6 years ago

Making a cart game, going to have many many conveyors with multiple speeds.

Would it be better this way in each conveyor block,

while wait(0.1) do
    script.Parent.Velocity = script.Parent.CFrame.lookVector * script.Parent.Speed.Value
end

Or do something like

while wait(0.1) do
    for i,v in pairs(workspace.Conveyors:GetChildren()) do
        if v.Name == "slowConveyor" then
            v.Velocity = v.CFrame.lookVector * 16
        elseif v.Name == "mediumConveyor" then
            v.Velocity = v.CFrame.lookvector * 30
        end
    end
end

The second one was just coded here, so if there's any errors I apologize.

0
If you want different speeds, I’d use the second one. User#19524 175 — 6y
0
Remove the while loop. hiimgoodpack 2009 — 6y
0
Remove the while loop. Fifkee 2017 — 6y
0
Remove the while loop. UnRandomizing 22 — 6y
View all comments (6 more)
0
Remove the while loop. Kullaske 111 — 6y
0
I'd use the second one DragRacer31 7 — 6y
0
Remove the while loop. MexheCo 46 — 6y
0
Remove the while loop. User#25606 0 — 6y
0
Remove the while loop. brokenVectors 525 — 5y
0
Remove the while loop. Fad99 286 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

There is a property inside a part which allows you to make conveyors without the use of code. It's called Velocity and when applied will move the part in the suggested location (X,Y,Z Coordinates.) Though if the value is too low it wont work for objects which weight to much and take up a large mass.

Ad

Answer this question