10
« on: October 10, 2021, 08:16:42 AM »
stupid idea
elseif PedIsValid(PedGetGrappleTargetPed(gplayer)) and PedIsPlaying(gplayer,"/Global/Actions/Grapples/Front/Grapples/Hold_Idle",true) and PedMePlaying(gplayer,"GIVE",true) and IsButtonPressed(15,0) then
local LastGrapplePed = PedGetGrappleTargetPed(gplayer)
local PLX,PLY,PLZ = PedGetPosXYZ(gplayer)
local currentSpeed = GameGetPedStat(LastGrapplePed,20)
local currentHealth = PedGetHealth(gplayer)
PedSetGrappleTarget(PedGetGrappleTargetPed(gplayer),-1)
PedSetGrappleTarget(gplayer, -1)
copyJimmy = PedCreateXYZ(0,PLX,PLY,PLZ)
PedSetHealth(copyJimmy,currentHealth)
GameSetPedStat(copyJimmy,20,currentSpeed)
PedSetGrappleTarget(LastGrapplePed,copyJimmy)
PedSetGrappleTarget(copyJimmy, LastGrapplePed)
PedSetFaction(copyJimmy,2)
CameraFollowPed(copyJimmy)
PedSetActionNode(copyJimmy,"/Global/Actions/Grapples/Front/Grapples/GrappleMoves/GrappleStrikes/HitA", "Globals/Nemesis.act")
PedAttack(copyJimmy,LastGrapplePed)
PedSetHitTree(gplayer,"/Global/HitTree/Standing/Melee/Generic/Float/Axehandle/Front","act/anim/hittree.act")
PedSetGrappleTarget(gplayer,copyJimmy)
Wait(100)
elseif PedIsValid(copyJimmy) and not PedMePlaying(copyJimmy,"HitA",true) then
local PLX,PLY,PLZ = PedGetPosXYZ(copyJimmy)
local currentHealth = PedGetHealth(copyJimmy)
CameraReturnToPlayer()
PlayerSetPosSimple(PLX,PLY,PLZ)
PedDelete(copyJimmy)
PedSetHealth(gplayer,currentHealth)
if PedGetHealth(gplayer) <= 0 then
PedApplyDamage(gplayer,999)
end
function PedSetHitTree(ped,HitTreeNode,HitTreeAct,GrappleHitTreeNode)
if PedGetHealth(ped) > 0 then
PedPlayHitReaction(ped)
PedSetActionNode(ped,HitTreeNode,HitTreeAct)
if PedIsValid(PedGetGrappleTargetPed(ped)) then
PedPlayHitReaction(PedGetGrappleTargetPed(ped))
PedSetActionNode(PedGetGrappleTargetPed(ped),GrappleHitTreeNode,HitTreeAct)
end
end
end