Ok so I have a friend trying to make a boat but it won't work in play mode but it works in build mode. Here is the script

script.Parent.BodyPosition.position = script.Parent.Position
script.Parent.BodyGyro.cframe = CFrame.fromEulerAnglesXYZ(0,3.14,0)
value1 = 0
while true do
wait()
if script.Parent.Throttle== 1 then
if value1 < 41 then value1 = value1+1 end
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
end
if script.Parent.Throttle == 0 then
value1 = 0
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
end
if script.Parent.Throttle== -1 then
if value1<31 then value1 = value1+1 end
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*-value1
end
if script.Parent.Steer == 1 then
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.1,0)
end
if script.Parent.Steer == -1 then
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,.1,0)
end
end

--VetexGames this goes in a VehicleSeat, with BodyGyro, BodyPosition, and BodyVelocity in it.

2 comments

0

Could you put the code into a code block so we can help you better?

0

I did