Jump to content
  • 0

Spawn monsters with despawn time


Question

Posted

I'm making a change to one of my npcs, where bandits (basically monsters) can spawn to try killing the player,

but to not bother other players by keeping them spawned for so long, I'm wanting to make so the bandits

have a despawn time, so after that time, they disappear for good from the map.

How can I do that?

3 answers to this question

Recommended Posts

  • 0
Posted
On 1/10/2017 at 3:27 AM, Akkarin said:

You can either add a timer to each mob or you can do a simple killmonster on the map. I guess it depends on the map..

I believe adding a timer to each mob is the best solution, since using kill monster on the map can end up killing bandits that spawned for other players too.

But how do I make a timer for a monster?

 

On 1/10/2017 at 8:16 AM, Skorm said:

You can try the summon command just be sure to run it from an npc that isn't attached to the player.


*summon "monster name",<monster id>{,<Time Out>{,"event label"}};

 

Some other methods...


.mob_id = monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
unitkill .mob_id;
stopnpctimer;
end;

 

You could do the same thing as above but with killmonster instead.


monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"NPC::OnBlahbanditded",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
killmonster "<map name>","NPC::OnBlahbanditded";
stopnpctimer;
end;

OnBlahbanditded:
end;

 

Ah, so there is how one does that.

Thank you, but I believe I will have to attach the timer on the player instead, this will be helpful anyway.

  • 0
Posted
4 hours ago, nakano15 said:

I believe adding a timer to each mob is the best solution, since using kill monster on the map can end up killing bandits that spawned for other players too.

But how do I make a timer for a monster?

You can try the summon command just be sure to run it from an npc that isn't attached to the player.

*summon "monster name",<monster id>{,<Time Out>{,"event label"}};

 

Some other methods...

.mob_id = monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
unitkill .mob_id;
stopnpctimer;
end;

 

You could do the same thing as above but with killmonster instead.

monster("<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"NPC::OnBlahbanditded",<size>,<ai>});
startnpctimer;
end;

OnTimer<time>:
killmonster "<map name>","NPC::OnBlahbanditded";
stopnpctimer;
end;

OnBlahbanditded:
end;

 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...