Bully-Board
Bully Modding Section => Modding Questions/Help => Topic started by: UmaruChan223 on March 23, 2022, 01:32:38 AM
-
I want to restore some kind of beta or unused moves such as tornado kick for G_Johnny or shoulder barge for J_Melee
Pls help people
-
"/Global/G_Johnny/Default_KEY/RisingAttacks/HeavyAttacks/RisingAttacks", "Act/Anim/G_Johnny.act"(tornado Kick)
"/Global/J_Melee_A/Offense/Medium/Strikes/Unblockable/ShoulderButt", "act/anim/J_Melee_A.act"(shoulder Barge)
-
You can use the code provided by J_Striker_A on this script, you may also change the code to suit your needs.
BTW.. this is only for Johnny:
X, Y, Z = PlayerGetPosXYZ()
if PedIsModel(ped, 23) then
if PedMePlaying(ped, "Default_KEY") then
if not PedIsPlaying(ped, "/Global/G_Johnny", true) then
PedSetActionTree(ped, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
end
if PedIsValid(PedGetTargetPed(ped)) and PedIsInCombat(ped) then
local PX, PY, PZ = PedGetPosXYZ(ped)
if math.abs(X - PX) + math.abs(Y - PY) + math.abs(Z - PZ) <= 2.0 and math.random(1, 100) < 5 then
PedSetActionNode(ped, node, file) -- replace node and file with J_Striker_A's action nodes or your own ones
end
end
end
end
That is how you can trigger NPC to do a custom attack animation simply and looks naturally. The chance of doing that animation is 5% (math.random(1, 100) < 5), i personally don't recommend you to set the chance higher than 20. Otherwise, it will be his favorite moves :laugh:.
Disclaimer: I did not test the code, but it was modified according to the attached picture.
-
You can also add PedMePlaying(ped,"StrafeIdle") on the "if PedIsValid(PedGetTargetPed(ped)) and PedIsInCombat(ped) then" line to make it so they only use the attack when doing their strafe idle, which is when the ai usually attacks.