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

Cant get script to work in OnAttack EE 2.8


Dyto
 Share

Recommended Posts

' Executes when a player presses the CONTROL key.
Sub OnAttack(Index, Damage)
Dim Target
Dim Range
Dim DMG
Range = Rand(100, 1)
DMG = Int(Damage) + Int(Range)
If Int(Damage) > 0 Then
If Int(GetPlayerTarget(Index)) > 0 Then
Target = GetPlayerTarget(Index)
Call DamagePlayer(Index, Target, Int(DMG))
Else
Target = GetPlayerTargetNPC(Index)
Call DamageNPC(Index, Target, Int(DMG))
End If
End If
End Sub

Sub OnArrowHit(Index, Damage)
Dim Target
Dim Range
Dim DMG
Range = Rand(100, 1)
DMG = Int(Damage) + Int(Range)
If Int(Damage) > 0 Then
If Int(GetPlayerTarget(Index)) > 0 Then
Target = GetPlayerTarget(Index)
Call DamagePlayer(Index, Target, Int(DMG))
Else
Target = GetPlayerTargetNPC(Index)
Call DamageNPC(Index, Target, Int(DMG))
End If
End If
End Sub

Sub PlayerHit(Index, NPCNum, Damage)
Dim Range
Dim DMG
Range = Rand(100, 1)
DMG = Int(Damage) + Int(Range)
If Damage > 0 then
Call NPCAttack(NPCNum, Index, Int(DMG))
End If
End Sub

Just trying to change the damage numbers but nothing seems to change the dmg and I've been spending like 2 hours trying to figure it out lol
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...