News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: How to Strafe (LUA Codes)  (Read 4036 times)

0 Members and 1 Guest are viewing this topic.

Offline AfterLife

  • The Reaper
  • Sr. Member
  • ***
  • Posts: 830
  • Gender: Male
  • I'm from the AfterLife...
    • View Profile
How to Strafe (LUA Codes)
« on: July 22, 2015, 09:33:45 AM »
Okay, till today, I noticed people still don't know how to strafe lol. I mean, strafing is getting old. 

Code: [Select]
if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
    PedSetActionNode(gPlayer,"/Global/Style/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","Act/Anim/Style.act")
isStrafing = true
  elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionTree(gPlayer,"/Global/Style", "Act/Anim/Style.act")
isStrafing = false
  elseif isStrafing then
local x,y,z = PedGetPosXYZ(PedGetTargetPed())
PedFaceXYZ(gPlayer,x,y,z)

IsMoving = function()
  local s = 0.08
  return GetStickValue(16,0) > s or GetStickValue(16,0) < -s or GetStickValue(17,0) > s or GetStickValue(17,0) < -s
end

Copy and paste it in your script. Or simply make a new function. You must add the IsMoving() or else it will not work. You need NOT make a new function for the IsMoving () part. Replace "Style" with the fighting style you are using.


Special thanks to unknownsoldier for giving me this code back in 2014.

QnA:

Q: Do you have full strafe??? Can you give me it??
A: I do, but I will not release it due to several reasons. Leechers, accusers etc.
If I did release it, some people would come and attack me and call me a leech.

Q: Can you send me P_Striker_A evades?
A: Its not controllable. I'm trying to find the nodes.

Q: Do you still mod?
A: Sometimes. I just mostly help Shrimp and some other members these days.


Offline denizthebest

  • Jr. Member
  • **
  • Posts: 85
  • Half way there.
    • View Profile
Re: How to Strafe (LUA Codes)
« Reply #1 on: July 22, 2015, 10:21:55 AM »
Nice but i think it should be under tutorial section