RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create an advanced train driving system"
-- server script local train = game.Workspace.Train local speed = 0 train:GetPropertyChangedSignal("Speed"):Connect(function() speed = train.Speed end) local function moveTrain(direction) if direction == "forward" then speed = speed + 0.5 elseif direction == "backward" then speed = speed - 0.5 end train.Speed = speed end game.ReplicatedStorage.TrainControl.OnServerEvent:Connect(moveTrain)