I have tryed to create an intem into a chest un random positions, but all attempts are failed:
item.x := RandomInt(150) + 20 + 1;
item.y := RandomInt(130) + 20 + 1;
fail
MoveItemToContainer(item, container, RandomInt(150) + 20 + 1, RandomInt(120) + 20 + 1);
fail
all fails.
putting item in random position in metallic chest
Are you certain that the range is within the bounds of the container into which you are trying to drop the item? Also if you read the docs for the function it says "If the default values for x and y are passed, or if x or y does not fall within the legal bounds for a container as found in ITEMDESC.CFG, then a random location within the container will be chosen. " So if you don't send any values for x and y then the function automatically chooses a random location.