Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent.MaxSpeed = 10000
- maxspeed =script.Parent.MaxSpeed
- script.Parent.BodyPosition.Position = script.Parent.Position--------------------DO NOT CHANGE ANYTHING!
- value1 = 0
- game.Workspace.Events1.Forwards.OnServerEvent:connect(function()
- print("F")
- if value1 < maxspeed then
- value1 = value1+25
- end
- script.Parent.Parent.Driving.Value = true
- script.Parent.Parent.Left.Value = false
- script.Parent.Parent.Right.Value = false
- return value1
- end)
- game.Workspace.Events1.Backwards.OnServerEvent:connect(function()
- print("B")
- if value1< maxspeed then
- value1 = value1-25
- end
- if value1 == maxspeed then
- value1 = value1-25
- end
- script.Parent.Parent.Driving.Value = true
- script.Parent.Parent.Left.Value = false
- script.Parent.Parent.Right.Value = false
- return value1
- end)
- game.Workspace.Events1.StarboardTurn.OnServerEvent:connect(function()
- --script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.045,0)
- script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
- script.Parent.Parent.Driving.Value = true
- script.Parent.Parent.Right.Value = true
- script.Parent.Parent.Left.Value = false
- script.Parent.BodyAngularVelocity.AngularVelocity = Vector3.new(0,-0.2,0)
- end)
- game.Workspace.Events1.PortTurn.OnServerEvent:connect(function()
- --script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,.045,0)
- script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
- script.Parent.Parent.Driving.Value = true
- script.Parent.Parent.Left.Value = true
- script.Parent.Parent.Right.Value = false
- print("NEG")
- script.Parent.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0.2,0)
- end)
- game.Workspace.Events1.StopTurn.OnServerEvent:connect(function()
- script.Parent.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0)
- end)
- game.Workspace.Events1.Reset.OnServerEvent:connect(function()
- script.Parent.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0)
- value1 = 0
- end)
- while wait(0.1) do
- script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement