[FOTL]Aphex Posted January 28, 2012 Share Posted January 28, 2012 I'm making a jump script that works fine so far, but I'd like it to be so that when you jump you cant jump until you're on the floor again. As it is at the moment I just have a timer that only lets you jump once every 500ms, but if they were to jump off somewhere high they could still "jump" every 500ms. I've tried checking the Z velocity first, to make sure it was between -0.02 and 0.02, but the jump doesnt work if you're driving up or downhill... or at the peak of the jump (you're z velocity goes to 0 momentarily). function jumpy(player) local veh = getPedOccupiedVehicle(player) if ok == true then if (veh) then local x,y,z = getElementVelocity(veh) setElementVelocity (veh, x, y, z+0.2) ok = false setTimer(function() ok = true end,500,1) end end end Link to comment
Castillo Posted January 28, 2012 Share Posted January 28, 2012 Do you mean checking if the vehicle is on ground? if so: https://wiki.multitheftauto.com/wiki/IsVehicleOnGround Link to comment
[FOTL]Aphex Posted January 28, 2012 Author Share Posted January 28, 2012 Do you mean checking if the vehicle is on ground? if so: https://wiki.multitheftauto.com/wiki/IsVehicleOnGround haha yeah thats what I meant... I've just been scouring the wiki and didn't spot it. Thanks a lot... and for the quick reply! Link to comment
arezu Posted January 28, 2012 Share Posted January 28, 2012 isVehicleOnGround does only work when you are on a somewhat flat ground and not with all vehicles Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now