Jaiden Posted October 18, 2008 Author Share Posted October 18, 2008 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 More sharing options...
Bobosk Posted October 18, 2008 Share Posted October 18, 2008 when you're setting vars, you don't need to put "call"```Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)dim NPC_Xdim NPC_yNPC_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 More sharing options...
Jaiden Posted October 18, 2008 Author Share Posted October 18, 2008 Funny. I had it without call before, and I thought that was the issue.And I do have that sound :PThanks a lot! Link to comment Share on other sites More sharing options...
Bobosk Posted October 18, 2008 Share Posted October 18, 2008 well, there's another thing i changed…```NPC_X = getnpcx(Map, NPCIndex)NPC_Y = getnpcy(Map, NPCIndex)```NPCNum is the number of the npc(/editnpcs)while npcindex is the spot they are in your mapeditor 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