drop limmited

This commit is contained in:
Alexsandro Percy 2022-03-21 20:26:30 -03:00
parent 796b52b4e8
commit 6213cfaa71
1 changed files with 4 additions and 1 deletions

View File

@ -97,9 +97,12 @@ function airutils.remove_inventory(self)
if inv_content then
local pos = self.object:get_pos()
for k, v in pairs(inv_content) do
local count = 0
for i = 0,v:get_count()-1,1
do
do
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},v:get_name())
count = count + 1
if count >= 5 then break end
end
end
end