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

How do I stop my boat from going up on land?

Asked by
Prioxis 673 Moderation Voter
8 years ago

So my boat in my game it can fly up the beach (a wedge) and then it doesn't go back down

here's the movement script found within the Vehicle Seat

local bv = script.Parent.BodyVelocity

local bav = script.Parent.BodyAngularVelocity

local seat = script.Parent

local speed = 0
local maxSpeed = 40
local rotSpeed = 0
local maxRotSpeed = 2

--Start the constant movement calculator
delay(0, function()
    while true do
        bv.velocity = seat.CFrame.lookVector * speed
        bav.angularvelocity = Vector3.new(0, rotSpeed, 0)
        wait()
    end
end)

seat.Changed:connect(function(prop)
    if prop == "Throttle" then
        if seat.Throttle == 1 or seat.Throttle == -1 then

            speed = maxSpeed * seat.Throttle

        elseif seat.Throttle == 0 then

            speed = 0

        end
    elseif prop == "Steer" then
        if seat.Steer == -1 or seat.Steer == 1 then

            rotSpeed = maxRotSpeed * -seat.Steer

        elseif seat.Steer == 0 then

            rotSpeed = 0

        end
    end
end)

Explorer (Boat Model)

Body Velocity

BodyGyro

BodyAngularVelocity

Answer this question