1
Modding Questions/Help / Re: LUA/.dat file that contains data on random fights
« on: August 04, 2022, 06:12:26 PM »
some random fights function be triggered by .idb in Ide.img
News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..
Messages |
Topics |
Attachments
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
local isHitedPed = {}
main = function()
while not SystemIsReady() or AreaIsLoading() do
Wait(0)
end
while true do
for i,ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
if (HitIsPlaying(ped,"/Global/J_Mascot/Offense/Medium/Strikes/LightAttacks/WindMill_R/WindMill_L") or HitIsPlaying(ped,"/Global/Crazy_Basic/Offense/Short/Short/Strikes/LightAttacks/WindMill_R/WindMill_L")) and PedGetNodeTime(ped) >= 0.12 and not PedMePlaying(PedGetWhoHitMeLast(ped)"SwingPunch_R",true)and not PedIsBlocking(ped)and not PedIsPlaying(ped,"/Global/HitTree/Standing/Melee/Generic/Left/HEADHOOK",true)then
PedApplyDamage(ped,15 * PedGetDamageGivenMultiplier(ped, 2))
isHitedPed[ped] = true
end
if HitIsPlaying(ped,"/Global/J_Melee_A/Offense/Medium/Strikes/HeavyAttacks/HeavyRight") and not PedIsBlocking(ped)and not PedIsPlaying(ped,"/Global/HitTree/Standing/Melee/Generic/Straight/HEAVYSTRAIGHT2",true)then
PedApplyDamage(ped,30 * PedGetDamageGivenMultiplier(ped, 2))
isHitedPed[ped] = true
end
end
for ped,v in pairs(isHitedPed)do
if (PedGetNodeTime(PedGetWhoHitMeLast(ped)) <= 0.1 and not PedIsPlaying(PedGetWhoHitMeLast(ped),"/Global/J_Melee_A/Offense/Medium/Strikes/HeavyAttacks/HeavyRight/HeavyRight_LAND",true)) or not PedIsValid(PedGetWhoHitMeLast(ped)) or PedGetHealth(ped) <= 0 then
isHitedPed[ped] = nil
end
end
Wait(0)
end
end
function PedIsBlocking(ped)
if not PedMePlaying(ped,"Block",true)or not PedMePlaying(ped,"0_BLOCK_0",true)then
return false
end
return true
end
function HitIsPlaying(ped,node)
return PedGetHealth(ped) > 0 and PedIsHit(ped,2,200) and PedIsValid(PedGetWhoHitMeLast(ped)) and PedIsPlaying(PedGetWhoHitMeLast(ped),node,true) and not PedMePlaying(ped,"Cars",true)and isHitedPed[ped] == nil
end
/Global/J_Mascot/Offense/Short/Heavy/Stunners/Sack/SackFreq/GutKick_R
PlayerSetControl(0)
PlayerLockButtonInputsExcept(true)
PedSetActionTree(gplayer,"/global/p_striker_a","act/p_striker_a.act")
PedSetTaskNode(gplayer,"evadeback","AI.act")
Wait(0)
PedSetAITree(gplayer, "/Global/PlayerAI", "Act/PlayerAI.act")
PlayerSetControl(1)
local lastWeapon = PedGetWeapon(gplayer)
while PedMePlaying(gplayer,"evadeback",true) do
PedSetWeapon(gplayer,lastWeapon)
Wait(0)
end
PedSetActionTree(gplayer, "/global/player","act/player.act")
Wait(0)
PlayerLockButtonInputsExcept(false)