Ok, i have 2 inventories per mob (contents1 and contents2) and i want to know how to make 2 proc's of which would:
1) Randomly pick 1 item from contents1 and MOVE into contents2
2) Randomly pick 5 items from contents1 1 and MOVE them into contents2
I guess i could just type out the first proc 5 times but still want to know if there is a quicker way. I would be thankful if someone could reply to me with a sample code to number 1 so that i could get under way with the rest of my coding, thanks in advance, Timewiz.
ID:166708
![]() Jun 26 2006, 10:35 am
|
|
Rather than do it five times, try a while statement.
var/count=5 Below will ensure that the action is done before testing the value of count. var/count=5 The last way this can be done (senseibly) is with a for loop. for(var/count=5,count>0,count--) |
To loop through or repeat an action see while() or for().