y453bh Posted April 9, 2020 Share 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. Link to comment
Infinity-War Posted April 9, 2020 Share 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' Link to comment
y453bh Posted April 9, 2020 Author Share 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! Link to comment
Infinity-War Posted April 9, 2020 Share 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 Link to comment
y453bh Posted April 9, 2020 Author Share 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 Link to comment
Infinity-War Posted April 9, 2020 Share 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 Link to comment
y453bh Posted April 9, 2020 Author Share 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 Link to comment
Infinity-War Posted April 9, 2020 Share Posted April 9, 2020 1 minute ago, y453bh said: Its not working @Infinity-War i don't understand man , you have an exmaple ? Link to comment
y453bh Posted April 9, 2020 Author Share 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. Link to comment
Moderators IIYAMA Posted April 9, 2020 Moderators Share 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: Link to comment
y453bh Posted April 9, 2020 Author Share Posted April 9, 2020 @Infinity-War Already gave you the example man, I need your help please!! Link to comment
Moderators IIYAMA Posted April 9, 2020 Moderators Share 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 Link to comment
Recommended Posts