------------------- JUMP ---------------------------
function Jump ( key, keyState )
local vehicle = getPlayerOccupiedVehicle(getLocalPlayer())
if ( keyState == "down" ) and ( isVehicleOnGround( vehicle ) == true ) then
end
local x, y, z = getElementVelocity(vehicle)
setElementVelocity(vehicle, x, y, z + 0.4)
end
bindKey ( "z", "down", Jump ) -- bind the player's z down key
The meaning of the script is that you can let your car jump with "Z".
the car jumps, but you can let it jump when it's not touching the ground.
and i can't fix it, it should only jump when you touch the ground.