mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
17 lines
494 B
Lua
17 lines
494 B
Lua
--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
|
|
minetest.env:add_item(pos, stack)
|
|
stack:clear()
|
|
inv:set_stack("main", i, stack)
|
|
pos.x = pos.x - x
|
|
pos.z = pos.z - z
|
|
end
|
|
end)
|
|
--end |