varinyc Posted June 23, 2009 Author Share Posted June 23, 2009 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 More sharing options...
The Oracle Posted June 23, 2009 Share Posted June 23, 2009 I would reregister the library files Link to comment Share on other sites More sharing options...
balliztik1 Posted June 23, 2009 Share Posted June 23, 2009 Are you using a custom OnAttack script? If so, post it. Link to comment Share on other sites More sharing options...
varinyc Posted June 23, 2009 Author Share Posted June 23, 2009 ```' 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 LoopEnd Sub```I don't think It's custom, But here it Is just in case. Link to comment Share on other sites More sharing options...
balliztik1 Posted June 23, 2009 Share Posted June 23, 2009 If your damage is 0, then you create an infinite loop. Switch the position of the If-statement for damage and the Do While. Link to comment Share on other sites More sharing options...
varinyc Posted June 23, 2009 Author Share Posted June 23, 2009 That Fixed the problem thank you ^_^. 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