emplay Posted August 12, 2009 Author Share Posted August 12, 2009 Ok im working on mining and for my vein of whatever im mining i have this```Case 50 Dim Weapon If GetPlayerWeaponSlot(index) > 0 Then Weapon = GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index)) Else Weapon = 0 End If If Weapon = 34 Then Call PlayerMsg(Index, "You've mined some ore!", WHITE) Call GiveItem(Index, 12, 1) Else Call PlayerMsg(Index, "You need a higher lvl pickaxe!", WHITE) End If```This works when i apply it to a scripted npc.But now i want to make the npc dissapear after being mined then respawn about 20 seconds later.So I tried the little box at the top of the Npc editor and changed the respawn number to 20 (seconds).But as all thing go. Something didn't work I can mine the ore and that works but the vein dosent dissapear.Can someone please help me with this.Thanks Link to comment Share on other sites More sharing options...
Roujo Posted August 13, 2009 Share Posted August 13, 2009 Well, you would have to tell the NPC to disappear, as it won't do it on it's own. As for the function that does that, I'll take a look and see what I can find. ^^ Link to comment Share on other sites More sharing options...
Diskmaster Posted August 13, 2009 Share Posted August 13, 2009 Call OnNPCDeath(index, NPCNUM)Change the NPCNUM to whatever npc number the thing isU probably know what to do with it… Link to comment Share on other sites More sharing options...
Roujo Posted August 13, 2009 Share Posted August 13, 2009 Actually, OnNPCDeath doesn't kill an NPC, it is called when one _is_ killed, though.We're trying to find a way to kill a Scripted NPC by script. Like a way to tell the NPC to self-terminate. XD Link to comment Share on other sites More sharing options...
Diskmaster Posted August 13, 2009 Share Posted August 13, 2009 No, I am pretty sure that It kills an NPC, if u just use Damage NPC, it won't ever kill it, test it out, it will kill it! I use this in my game If GetNPCHp(index)<1 ThenCall OnNPCDeath(Index, Map, NPCNum, NPCIndex)Not exactly functional, but I know this script is itReplace it with the map the NPC is on, the Number the NPC is on the map (1-15) and then NPC index with what the NPC number is! Link to comment Share on other sites More sharing options...
Owen F Posted August 13, 2009 Share Posted August 13, 2009 @Teh:> Actually, OnNPCDeath doesn't kill an NPC, it is called when one _is_ killed, though.> We're trying to find a way to kill a Scripted NPC by script. Like a way to tell the NPC to self-terminate. XDI'm backing diskmaster on this one. It should work the same as call ondeath. For it to trigger this sub, the npc has to die, so the sub kills it. Link to comment Share on other sites More sharing options...
Roujo Posted August 13, 2009 Share Posted August 13, 2009 Cool! I didn't know it did that. ^^My bad!Roujo Link to comment Share on other sites More sharing options...
emplay Posted August 13, 2009 Author Share Posted August 13, 2009 Ya i tried it today and diskmasters worked thankyou. 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