This tutorial will teach you how to make a locked on pedestrian do your desired action node.
First of all you will need to make a function, for this tutorial I will use:
F_PedNode = function()
Then you need to make a local and make it call PedGetTargetPed(gPlayer) so you won't have to type it always.
local Ped = PedGetTargetPed(gPlayer)
After that, you need to make an if/then statement using your desired buttons and add a PedIsValid(Ped) to make sure that the action node only activates if they are is a valid ped targeted. I made mine press the down arrow key.
if IsButtonPressed(3,0) and PedIsValid(Ped) then
Now, all you need to do is add your desired action node, I will make the ped I target use a running attack, just for fun.
ExecuteActionNode(Ped, "/Global/Actions/Offense/RunningAttacks/RunningAttacksDirect", "Act/Globals/GlobalActions.act")
Finally, you are done! The desired ped that you target will do the action node you provide. Here is the finished function that you can use and edit in your mods. Thanks for reading this tutorial!
F_PedNode = function()
local Ped = PedGetTargetPed(gPlayer)
if IsButtonPressed(3,0) and PedIsValid(Ped) then
ExecuteActionNode(Ped, "/Global/Actions/Offense/RunningAttacks/RunningAttacksDirect", "Act/Globals/GlobalActions.act")
end
end