News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..
0 Members and 3 Guests are viewing this topic.
TargetPed = PedGetTargetPed()if IsButtonBeingPressed(3,0) and TargetPed > 0 then PedSetActionNode(TargetPed, i dont have the node so you do this part)end
Get the ped you lock onto and make him do the node instead of the player.Code: [Select]TargetPed = PedGetTargetPed()if IsButtonBeingPressed(3,0) and TargetPed > 0 then PedSetActionNode(TargetPed, i dont have the node so you do this part)end
Quote from: DaBOSS54320 on October 18, 2013, 08:50:08 PMGet the ped you lock onto and make him do the node instead of the player.Code: [Select]TargetPed = PedGetTargetPed()if IsButtonBeingPressed(3,0) and TargetPed > 0 then PedSetActionNode(TargetPed, i dont have the node so you do this part)endWhy "TargetPed > 0"? And why "IsbuttonBeingPressed" instead of "IsbuttonPressed"?I haven't touched a lua code in like in 2 months.
Quote from: C62 on October 19, 2013, 10:01:49 PMQuote from: DaBOSS54320 on October 18, 2013, 08:50:08 PMGet the ped you lock onto and make him do the node instead of the player.Code: [Select]TargetPed = PedGetTargetPed()if IsButtonBeingPressed(3,0) and TargetPed > 0 then PedSetActionNode(TargetPed, i dont have the node so you do this part)endWhy "TargetPed > 0"? And why "IsbuttonBeingPressed" instead of "IsbuttonPressed"?I haven't touched a lua code in like in 2 months.TargetedPed >0 because the number 1 equels "on" which actives the command.IsButtonBeingPressed is set to avoid the animation to restart when holding the button and it only work again if the player leaves the button and presses it again.