Jump to content

[HELP] Shoot while jumping.


Recommended Posts

Hey, I want to extend the jump time with the help of setPedGravity and enable firing during this time. I extended the jump time with setPedGravity, but how do I get the character to shoot with the weapon?
Client:

addEventHandler("onClientRender", root, function()
    local move = getPedMoveState(localPlayer)     
    dxDrawText("Move State: "..move, 158, 225, 301, 358)

    if move == "jump" then
        triggerServerEvent("setGravity", localPlayer, localPlayer, move)
    else
        triggerServerEvent("setGravity", localPlayer, localPlayer, move)
    end
end)

Server:

addEvent("setGravity", true)
addEventHandler("setGravity", root, function(player, move)
    if move == "jump" then
        setPedGravity(player, 0.002)
    else
        setPedGravity(player, 0.008)
    end
end)

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...