Jump to content

Hi, help me with this script please...


y453bh

Recommended Posts

bindKey -- Jump Key
isPedInVehicle -- Check From Player if him in vehicle
getPedOccupiedVehicle -- get vehicle player
getElementVelocity -- get velocity
setElementVelocity -- set velocity
setTimer -- timer for jummping 

but for touching building ( real ) , you can create marker or colshape in a buldings and use 'onMarkerHit' or 'onColshapeHit'

Link to comment
  On 09/04/2020 at 13:00, Infinity-War said:

bindKey -- Jump Key
isPedInVehicle -- Check From Player if him in vehicle
getPedOccupiedVehicle -- get vehicle player
getElementVelocity -- get velocity
setElementVelocity -- set velocity
setTimer -- timer for jummping 

but for touching building ( real ) , you can create marker or colshape in a buldings and use 'onMarkerHit' or 'onColshapeHit'

Expand  

I appreciate ur help but I dont know how to script.. 

help!

Link to comment
-- # Client Side

local State , Seconds = false , 5

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		local vehType = getVehicleType(vehicle)
		if vehType == "Plane" or vehType == "Helicopter" then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

 

Link to comment
  On 09/04/2020 at 13:16, Infinity-War said:
-- # Client Side

local State , Seconds = false , 5

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		local vehType = getVehicleType(vehicle)
		if vehType == "Plane" or vehType == "Helicopter" then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

 

Expand  

 

I jump and turn the car 90 degrees in the air for hiting the wall, once I'm in the wall I press many times the shift key but It doesn't let me to jump without limits, help me please!!

Edited by y453bh
Link to comment
-- # Client Side

local State , Seconds , MaxZPosition = false , 5 , 10

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		if ( getGroundPosition ( Vector3 ( getElementPosition ( vehicle ) ) ) > MaxZPosition ) then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

try this

Link to comment
  On 09/04/2020 at 13:33, Infinity-War said:

-- # Client Side

local State , Seconds , MaxZPosition = false , 5 , 10

function initBind()
	bindKey("lshift", "down", jumpKey)
end
addEventHandler("onClientResourceStart", resourceRoot, initBind)

function jumpKey()
	if not isPedInVehicle(localPlayer) then return end
	if ( State == true ) then return end 
	local vehicle = getPedOccupiedVehicle(localPlayer)
	if vehicle and getVehicleController(vehicle) == localPlayer then
		if ( getGroundPosition ( Vector3 ( getElementPosition ( vehicle ) ) ) > MaxZPosition ) then return end
		local sx, sy, sz = getElementVelocity(vehicle)
		setElementVelocity(vehicle, sx, sy, sz + 0.33)
    	State = true
		setTimer ( function ( )
        	State = false
        end , 1000 * Seconds , 1 )
	end
end

try this

Expand  

Its not working @Infinity-War

Link to comment
  • IIYAMA locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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