--LAUNCHH!! the players items away from them when they die minetest.register_on_dieplayer(function(name, pos) local inv = name:get_inventory() local pos = name:getpos() for i = 1, 32, 1 do srcstack = inv:get_stack("main", i) if srcstack:to_string() ~= "" then pos.y = pos.y + 3 local obj = minetest.env:add_item(pos, srcstack:to_string()) local x = math.random(-5, 5) if x >= -2 and x <=0 then local x = x - 3 end if x > 0 and x <= 2 then local x = x + 3 end local y = math.random(3, 5) local z = math.random(-5, 5) if z >= -2 and z <= 0 then local z = z - 3 end if z > 0 and z <= 2 then local z = z + 3 end inv:set_stack("main", i, "") obj:setvelocity({x=x, y=y, z=z}) end if i == 32 then break end end end)