I need a math formula. There is a variable that that adds 1 per item you put in a menu. The menu has 4 spaces horizontally and 10 spaces vertically. You have to add 20 to x to move to the next box, and 20 to the y as well. When you pick up an item it goes into the first available space. The problem is that if you have four items and you pick up a fifth, it goes next to the fourth, not where i want it which is under the first. I need a formula that will put an item in the right space. Here is where it would go.
{///WIZARD HAT PICK UP
{collide.itemtype = strcmp(collide.name, wizhat.name);
if(collide.itemtype==0)
if(collide.itemown==0)
if(collide.hatequip==0)
ChangeParent("Collide Actor", "menu"),
collide.x=_________,
collide.y=_________,
menuquan=menuquan+1, collide.itemown=1;}