nakano15 Posted January 9, 2017 Posted January 9, 2017 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? Quote
0 Akkarin Posted January 9, 2017 Posted January 9, 2017 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.. Quote
0 nakano15 Posted January 9, 2017 Author Posted January 9, 2017 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. Quote
0 Skorm Posted January 10, 2017 Posted January 10, 2017 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; 1 Quote
Question
nakano15
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.