function postition(t)
--Why use stackpos ?
return (t.x ~= nil and t.y ~= nil and t.z ~= nil) and t or nil
end
function getRandomPositionFrom(fromPosition, toPosition)
local defaultPos = {x = 100, y = 100, z = 7}
return (postition(fromPosition) ~= nil and postition(toPosition) ~= nil) and {x = math.random(fromPosition.x, toPosition.x),y = math.random(fromPosition.y, toPosition.y), z = math.random(fromPosition.z, toPosition.z)} or defaultPos
end