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

Trying to make a boat, isn't working in play mode? [SOLVED] [Converted to Localscripts]

Asked by 10 years ago

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.

0
Could you put the code into a code block so we can help you better? AwsomeSpongebob 350 — 10y
0
I did MrN00bReaper 30 — 10y

Answer this question