Talon Posted November 30, 2014 Group: Members Topic Count: 24 Topics Per Day: 0.01 Content Count: 78 Reputation: 1 Joined: 09/01/14 Last Seen: October 22, 2016 Share Posted November 30, 2014 - script Sample -1,{ OnNPCKillEvent: //for( .@i = 0; .@i < .mob_size; .@i++ ) if( killedrid == .mob_size ){ getitem 512,1; } end; OnInit: setarray .mob_id[0],1002,1004,1005; .mob_size = getarraysize( .mob_id ); end; } Trying to get monsters' id using getarraysize, but tested like 2 hours, I did change lots of different codes but nothing's working Someone please help me :3 Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 30, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10013 Reputation: 2345 Joined: 10/28/11 Last Seen: Monday at 04:56 PM Share Posted November 30, 2014 your script is working fine, just that your dispbottom make you thought that you script is running infinite time. =='' - script Sample -1,{ OnNPCKillEvent: for( .@i = 0; .@i < .mob_size; .@i++ ) if( killedrid == .mob_id[.@i] ){ getitem 512,1; end; } dispbottom "No Drops"; end; OnInit: setarray .mob_id[0],1085,1084,1079,1080,1078,1083,1082,1081,1097; .mob_size = getarraysize( .mob_id ); end; } btw, if you have an infinity loop in your script, dispbottom doesnt solve the issue in fact it could make it worse. Anyway, if a script have infinite loop it should be auto terminated and display error in your map-server. Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 30, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10013 Reputation: 2345 Joined: 10/28/11 Last Seen: Monday at 04:56 PM Share Posted November 30, 2014 for( .@i = 0; .@i < .mob_size; .@i++ ) if( killedrid == .mob_id[.@i] ){ Quote Link to comment Share on other sites More sharing options...
Talon Posted November 30, 2014 Group: Members Topic Count: 24 Topics Per Day: 0.01 Content Count: 78 Reputation: 1 Joined: 09/01/14 Last Seen: October 22, 2016 Author Share Posted November 30, 2014 (edited) I was using that, but I got this, new line = after a mob's died. It has so many loops o.o Now every monsters can obtained a drop too... Here's the code - script Sample -1,{ OnNPCKillEvent: for( .@i = 0; .@i < .mob_size; .@i++ ) if( killedrid == .mob_id[.@i] ){ getitem 512,1; } else { dispbottom "No Drops"; } end; OnInit: setarray .mob_id[0],1085,1084,1079,1080,1078,1083,1082,1081,1097; .mob_size = getarraysize( .mob_id ); end; } I used else because I'm worried if there's infinite loops.. Or I can't use else for it? Edited November 30, 2014 by Talon Quote Link to comment Share on other sites More sharing options...
Talon Posted November 30, 2014 Group: Members Topic Count: 24 Topics Per Day: 0.01 Content Count: 78 Reputation: 1 Joined: 09/01/14 Last Seen: October 22, 2016 Author Share Posted November 30, 2014 Yea, I got it done, thanks once again! Quote Link to comment Share on other sites More sharing options...
Question
Talon
Trying to get monsters' id using getarraysize, but tested like 2 hours, I did change lots of different codes but nothing's working Someone please help me :3
Link to comment
Share on other sites
4 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.