bose Posted May 11, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 03/22/12 Last Seen: May 31, 2012 Share Posted May 11, 2012 nid help on how to make random item on this script prontera,155,181,5 script Freebies 2035,{ if(#dailytimer < gettimetick(2)) { mes "Here's your prize, you'll get another one after 24 hours."; getitem 7528,1; //remove <id> and add your own ids for item set #dailytimer,gettimetick(2) + 86400; //24 hours. close; } end; } Quote Link to comment Share on other sites More sharing options...
Arcenciel Posted May 11, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 1315 Reputation: 372 Joined: 12/10/11 Last Seen: August 31, 2013 Share Posted May 11, 2012 Set an array with the IDs of the items you want and then use rand to generate a number to be used setarray .@var[0],1234,5678,8901; getitem .@var[rand(0,3)],1; Test the second line out. I haven't scripted in a while and not quite sure if rand will work inside. Quote Link to comment Share on other sites More sharing options...
bose Posted May 12, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 03/22/12 Last Seen: May 31, 2012 Author Share Posted May 12, 2012 how can i set the chance for every item? Quote Link to comment Share on other sites More sharing options...
Arcenciel Posted May 12, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 1315 Reputation: 372 Joined: 12/10/11 Last Seen: August 31, 2013 Share Posted May 12, 2012 Lets say you have a pool of 10 different items which means 10 items = 10% chance for each one to appear. If you want to say increase item 1234's chances, you just have to use 2 of those 10 slots so now items 1234 has 20% of appearing compared to the rest. I haven't done a random item drawing with different chances for each item, so I'm not exactly sure how to do it either besides what I just mentioned. Quote Link to comment Share on other sites More sharing options...
Question
bose
nid help on how to make random item on this script
prontera,155,181,5 script Freebies 2035,{
if(#dailytimer < gettimetick(2)) {
mes "Here's your prize, you'll get another one after 24 hours.";
getitem 7528,1; //remove <id> and add your own ids for item
set #dailytimer,gettimetick(2) + 86400; //24 hours.
close;
}
end;
}
Link to comment
Share on other sites
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.