VictorOtInfinit
Member
- Joined
- Mar 14, 2020
- Messages
- 139
- Solutions
- 3
- Reaction score
- 11
Why this
always return 0?
Already tried with
and getWeight(1) and this return 0 too.
I'm trying to make impossible to a player put more itens inside a container that have 9.999 oz.
I did this one but i'm trying without an FOR:
Code:
getItemWeight(container.uid,1)
Already tried with
Code:
ItemType(container.uid):getWeight()
Code:
if item:getType():isPickupable() then
if toPosition.x == CONTAINER_POSITION then
local container = getTileItemByType(toCylinder:getPosition(),ITEM_TYPE_CONTAINER)
if container then
if item:getWeight() + getItemWeight(container.uid,1) >= 999999 then
self:sendCancelMessage('You cannot put more itens in here.')
return false
end
end
end
end
I'm trying to make impossible to a player put more itens inside a container that have 9.999 oz.
I did this one but i'm trying without an FOR:
Code:
if item:getType():isPickupable() then
if toPosition.x == CONTAINER_POSITION then
local container = Tile(toCylinder:getPosition()):getItems()
local itemTemp
for i = 1, #container do
itemTemp = container[i]
if ItemType(itemTemp:getId()):isContainer() then
if item:getWeight() + itemTemp:getWeight() >= 999999 then
self:sendCancelMessage('You cannot put more itens in here.')
return false
end
break
end
end
end
end
Last edited: