Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Attack Error (EE 2.8)


varinyc
 Share

Recommended Posts

Whenever anyone attacks an NPC, the server says the scripts are taking longer than expected and gives me a Continue, and End option. I've tried continue, which never works. It's been doing it since I downloaded the program.
Link to comment
Share on other sites

```
' Executes when a player presses the CONTROL key.
Sub OnAttack(Index, Damage)
Dim Target
Dim I
Dim M
Dim Count
Count = 0
Do While Count < 10
If Int(Damage) > 0 Then
If Int(GetPlayerTarget(Index)) > 0 Then
Target = GetPlayerTarget(Index)
Call DamagePlayer(Index, Target, Damage)
I = GetPlayerSPEED(Index)/4
If I > 40 Then I = 40
If I < 1 Then I = 1
M = Rand(0,100)
If I > M Then
Count = Count + 1
Else
If Count > 0 Then
Call BattleMsg(Index, "Your speed has allowed you to attack " & (Count + 1) & " times!", YELLOW, 0)
End If
M = (Count + 1) * Damage
Call BattleMsg(Index, "Damage: " & M & ".", WHITE, 0)
Count = 10
End If
Else
Target = GetPlayerTargetNpc(Index)
Call DamageNPC(Index, Target, Damage)
I = GetPlayerSPEED(Index)/4
If I > 40 Then I = 40
If I < 1 Then I = 1
M = Rand(0,100)
If I > M Then
Count = Count + 1
Else
If Count > 0 Then
Call BattleMsg(Index, "Your speed has allowed you to attack " & (Count + 1) & " times!", YELLOW, 0)
End If

M = (Count + 1) * Damage
Call BattleMsg(Index, "Damage: " & M & ".", WHITE, 0)
Count = 10
End If
End If
End If
Loop
End Sub

```
I don't think It's custom, But here it Is just in case.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...