Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I make a train throttle system?

Asked by 12 days ago

So, I tried making a train throttle system for my new train game. I'm trying to make the train keep at the speed that you set it after you stopped hitting "W" or "S". Basically, no automatic deceleration.

I tried this, but the train just flies away!

(It's a server script placed inside the vehicleseat)

while true do
    game:GetService("RunService").Heartbeat:wait()
    local magnitude = script.Parent.Velocity
    if script.Parent.Throttle == 0 then
        script.Parent.Velocity = magnitude
    end
end

Any help would be appreciated!

0
You can't use RunService in a server script Pupppy44 471 — 12d

Answer this question