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

How would I make a A-Chassis that stops when you jump out?

Asked by 3 years ago

How would I make a A-Chassis that stops when you jump out? I have looked at some dev forum things but nothing worked. I would like it to work similarly to what ER:LC's cars work like . I have tried this script but it didn't work:

local VehicleSeat = script.Parent
VehicleSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
    if VehicleSeat.Occupant then
        local Occupant = VehicleSeat.Occupant
        Occupant.Seated:Connect(function(Active)
            if not Active then
                for _, Part in pairs(VehicleSeat.Parent.Body:GetDescendants()) do
                    if Part:IsA("BasePart") then
                        Part.Velocity = Vector3.new()
                        Part.RotVelocity = Vector3.new()
                    end
                end
            end
        end)
    end
end)

I have also replaced GetDescendants() with GetChildren() So I really don't know were to go from here. There is no errors with the script so, if you could rewrite this script or make a new one that would be greatly appreciated.

Answer this question