Valentine90 Posted September 11, 2012 Author Share Posted September 11, 2012 **Sorry my english****Valentine**I saw this tutorial originally posted here, he had a few bugs, was incomplete and only worked with npcs, so I completed.**Deathbeam**This tutorial will do the following: If you have target and faces the same, the player will automatically attack him to death.**CLIENT SIDE****1 -** In **frmMain**, create in **picOptions**> **Checkbox> > Name:** chkAutoAttack> > **Caption:** Auto Ataque**2 -** In **modGameLogic** find this:```Dim tmr10000 As Long```**3 -** Below add:```Dim x As Long, y As Long```**4 -** Now look for:```If CanMoveNow ThenCall CheckMovement ' Check if player is trying to moveCall CheckAttack ' Check to see if player is trying to attackEnd If```**5 -** Replace with this:```If frmMain.chkAutoAttack.Value = YES ThenIf CanMoveNow ThenSelect Case Player(MyIndex).DirCase DIR_UPX = GetPlayerX(MyIndex)y = GetPlayerY(MyIndex) - 1Case DIR_DOWNX = GetPlayerX(MyIndex)y = GetPlayerY(MyIndex) + 1Case DIR_LEFTX = GetPlayerX(MyIndex) - 1y = GetPlayerY(MyIndex)Case DIR_RIGHTX = GetPlayerX(MyIndex) + 1y = GetPlayerY(MyIndex)End SelectIf myTargetType = TARGET_TYPE_NPC ThenIf X = MapNpc(myTarget).X And y = MapNpc(myTarget).y Then ControlDown = TrueElseIf myTargetType = TARGET_TYPE_PLAYER ThenIf X = Player(myTarget).X And y = Player(myTarget).y Then ControlDown = TrueEnd IfCall CheckMovement ' Check if player is trying to moveCall CheckAttack ' Check to see if player is trying to attackEnd IfElseIf CanMoveNow ThenCall CheckMovement ' Check if player is trying to moveCall CheckAttack ' Check to see if player is trying to attackEnd IfEnd If```**Credits:**Deathbeam (As the original creator of the tutorial)Valentine (By correcting some errors in the tutorial and post here) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now