Kawita Posted December 14, 2023 Group: Members Topic Count: 7 Topics Per Day: 0.01 Content Count: 13 Reputation: 0 Joined: 06/11/23 Last Seen: January 6, 2024 Share Posted December 14, 2023 How do I get a script or function to release a mob right at my coordinate and after 10 seconds if I don't eliminate it, the mob simply disappears? I tried using getmapxy but no luck Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted December 15, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted December 15, 2023 (edited) prontera,150,150,6 script Dev 123,{ // get player coordinates. getmapxy(.@map$, .@x, .@y); // clear array of mob ids and spawn the mobs at the players coordinates. cleararray($@mobid[0], 0, getarraysize($@mobid)); monster(.@map$, .@x, .@y, "", .mob_id, .mob_amount); // add the spawned mobs to the mob queue. for(.@i = 0; .@i < getarraysize($@mobid); .@i++) { .@next_index = getarraysize(.mob_queue); .mob_queue[.@next_index] = $@mobid[.@i]; .mob_queue[.@next_index + 1] = gettimetick(2); } end; OnInit: // config .mob_id = 1002; .mob_amount = 1; .timeout = 10; // start a infinite loop that.. freeloop(1); while(true) { // checks every second for mobs that have existed for .timeout seconds, kill them and remove them from the mob queue. for(.@i = 0; .@i < getarraysize(.mob_queue); .@i += 2) { if(gettimetick(2) - .mob_queue[.@i + 1] == .timeout) { unitkill(.mob_queue[.@i]); deletearray(.mob_queue[.@i], 2); .@i -= 2; } } sleep(1000); } freeloop(0); } Edited December 15, 2023 by Winterfox Quote Link to comment Share on other sites More sharing options...
Question
Kawita
How do I get a script or function to release a mob right at my coordinate and after 10 seconds if I don't eliminate it, the mob simply disappears? I tried using getmapxy but no luck
Link to comment
Share on other sites
1 answer 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.