Bully-Board

Bully Modding Section => Script Modding => Topic started by: GreenOmnitrix on February 20, 2015, 08:17:05 PM

Title: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: GreenOmnitrix on February 20, 2015, 08:17:05 PM
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:

Code: [Select]
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.

Code: [Select]
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.

Code: [Select]
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.

Code: [Select]
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!
Code: [Select]
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


Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: AfterLife on February 20, 2015, 08:18:56 PM
Nice tut!
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: deadpoolXYZ on February 20, 2015, 08:51:17 PM
Nice tutorial m8!

I might use this later for something.
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: SWEGTA on February 20, 2015, 11:44:46 PM
Good tutorial.  :cc_detective:
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: DaBOSS54320 on February 21, 2015, 12:17:07 AM
When you get sick of making Jimmy play your action nodes, have your enemies do them instead! They certainly need a bit of help up against Jimmy... let alone modding Jimmy.
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: Kikymaki on February 21, 2015, 02:39:56 AM
nice josh,
im still waiting you rigging tutorial release
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: Ky on February 21, 2015, 08:48:21 AM
Good tutorial, tell me more, this works for any PED?
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: GreenOmnitrix on February 21, 2015, 10:14:39 AM
Good tutorial, tell me more, this works for any PED?

As long as you target the ped, then yes.
Title: Re: [Tutorial] How to make Targeted Pedestrians do an Action Node
Post by: Unknownsoldier on March 08, 2015, 03:38:41 AM
it not work need help send codigos chad