y453bh Posted April 9, 2020 Posted April 9, 2020 (IM NEW) I need a script to jump with vehicles (with a timer) and if I turn the car and touch a building it lets me jump without limits, I hope you understand.
Infinity-War Posted April 9, 2020 Posted April 9, 2020 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' [Infinity War] Server - Soon .
y453bh Posted April 9, 2020 Author Posted April 9, 2020 Just now, 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' I appreciate ur help but I dont know how to script.. help!
Infinity-War Posted April 9, 2020 Posted April 9, 2020 -- # 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 [Infinity War] Server - Soon .
y453bh Posted April 9, 2020 Author Posted April 9, 2020 (edited) 10 minutes ago, 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 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 April 9, 2020 by y453bh
Infinity-War Posted April 9, 2020 Posted April 9, 2020 -- # 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 [Infinity War] Server - Soon .
y453bh Posted April 9, 2020 Author Posted April 9, 2020 Just now, 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 Its not working @Infinity-War
Infinity-War Posted April 9, 2020 Posted April 9, 2020 1 minute ago, y453bh said: Its not working @Infinity-War i don't understand man , you have an exmaple ? [Infinity War] Server - Soon .
y453bh Posted April 9, 2020 Author Posted April 9, 2020 1 minute ago, Infinity-War said: i don't understand man , you have an exmaple ? All fine with the script but, what I want is that when I'm like this on a building or wall, It lets me do the jump without time restriction. That way I can press the key several times to go flying through the air.
Moderators IIYAMA Posted April 9, 2020 Moderators Posted April 9, 2020 1 hour ago, y453bh said: I appreciate ur help but I dont know how to script.. 13 minutes ago, y453bh said: Help community!! This section is for learning to script, feel free to make use of that. Unfortunately scripting requests are not allowed in this section. Please read the section rules: Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
y453bh Posted April 9, 2020 Author Posted April 9, 2020 @Infinity-War Already gave you the example man, I need your help please!!
Moderators IIYAMA Posted April 9, 2020 Moderators Posted April 9, 2020 (edited) 4 minutes ago, y453bh said: @Infinity-War Already gave you the example man, I need your help please!! Then use a private message with him... leave me out of it. Locked, reason: scripting request Edited April 9, 2020 by IIYAMA Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts