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

A little help with a little script. [SOLVED]


Jaiden
 Share

Recommended Posts

I need help with this script…

I made an addition to "Sub OnNPCDeath", but it doesn't work right.
I'm trying to get it to play an animation over the NPC, and play a sound... However it doesn't work right.

I'm probably doing something stupid and obvious.

Anyway, here's the troublesome code:
```
Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)
Dim NPC_X
Dim NPC_Y

NPC_X = Call GetNpcX(Map, NPCNum)
NPC_Y = Call GetNpcY(Map, NPCNum)

SpellAnim(1, Map, NPC_X, NPC_Y)
Call PlaySound("Enemy_Kill.wav")
Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)
End Sub
```
Link to comment
Share on other sites

when you're setting vars, you don't need to put "call"
```
Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)
dim NPC_X
dim NPC_y

NPC_X = getnpcx(Map, NPCIndex)
NPC_Y = getnpcy(Map, NPCIndex)

SpellAnim(1, Map, NPC_X, NPC_Y)
Call PlaySound("Enemy_kill.wav")
Call BattleMsg(Index, "You killed a " & GetNPCName(NPCNum) & ".", BrightRed, 0)
End Sub
```Also, you need to make sure you actually have a sound in the client named "Enemy_kill.wav"
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...