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

Working on mining


emplay
 Share

Recommended Posts

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

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 Then
Call OnNPCDeath(Index, Map, NPCNum, NPCIndex)
Not exactly functional, but I know this script is it
Replace 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

@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. XD

I'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

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...