Jump to content

[HELP]Jump Highter


joaosilva099

Recommended Posts

nobody?

Try using gravity for example :

Client Script :

  
function jump() 
    if not isPedInVehicle(getLocalPlayer()) then -- here you check if the player is not in a vehicle (in other words "on foot") 
     
        local moveState = getPedMoveState( getLocalPlayer() ) -- Get the player move state 
         
        if moveState == "jump" then 
         
            setGravity ( 0.001 ) 
             
        elseif moveState ~= "jump" then 
         
            setGravity ( 0.008 ) 
         
        end 
    end 
end 
addEventHandler("onClientRender", getRootElement(), jump)  
  
  
  

^tested and working

Link to comment
thanks men that worked but how can i only set the gravity only for local player?

You mean only for one player ? if so

i will add a command for the players that want to jump higher

  
  
playerDo = 0 -- Default Status , change to 1 if you want the default status ON which will make all players jump high when the resource start 
    function jump() 
if playerDo == 1 then 
        if not isPedInVehicle(getLocalPlayer()) then -- here you check if the player is not in a vehicle (in other words "on foot") 
        
            local moveState = getPedMoveState( getLocalPlayer() ) -- Get the player move state 
            
            if moveState == "jump" then 
            
                setGravity ( 0.001 ) 
                
            elseif moveState ~= "jump" then 
            
                setGravity ( 0.008 ) 
            
            end 
        end 
        end 
    end 
    addEventHandler("onClientRender", getRootElement(), jump) 
  
function jumpset() 
if playerDo == 0 then 
    outputChatBox("Cheat Activated", 0, 255, 0, true ) 
   playerDo = 1 
elseif playerDo == 1 then 
   outputChatBox("Cheat Deactivated", 255, 0, 0, true ) 
   setGravity ( 0.008 ) 
   playerDo = 0 
end 
end      
addCommandHandler("jumptoggle", jumpset) -- Command to toggle the status(Cheat) 
      

if you type /jumptoggle you will toggle it, default is off

Link to comment

How will it work like that? It will do it for each CLIENT.

You must trigger from server like this

Server:

  
      triggerClientEvent(someElement, "hi", someElement) 
  

Client:

  
addEvent("hi", true) 
addEventHandler('hi', root, function() 
     -- do stuff 
end 
  

This will be triggered for specified element/player.

This is only a example, do it yourself and tell us if you get a error.

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...