2015-06-29 20:55:56 +03:00
|
|
|
--if minetest.setting_get("keepInventory") == false then
|
|
|
|
minetest.register_on_dieplayer(function(player)
|
|
|
|
local inv = player:get_inventory()
|
|
|
|
local pos = player:getpos()
|
|
|
|
for i,stack in ipairs(inv:get_list("main")) do
|
|
|
|
local x = math.random(0, 9)/3
|
|
|
|
local z = math.random(0, 9)/3
|
|
|
|
pos.x = pos.x + x
|
|
|
|
pos.z = pos.z + z
|
2017-01-11 19:21:46 +02:00
|
|
|
minetest.add_item(pos, stack)
|
2015-06-29 20:55:56 +03:00
|
|
|
stack:clear()
|
|
|
|
inv:set_stack("main", i, stack)
|
|
|
|
pos.x = pos.x - x
|
|
|
|
pos.z = pos.z - z
|
|
|
|
end
|
|
|
|
end)
|
2017-01-11 19:21:46 +02:00
|
|
|
--end
|