Add items on respawn
This commit is contained in:
parent
1e25f378f0
commit
4a713b4f70
2 changed files with 7 additions and 6 deletions
|
@ -1,10 +1,14 @@
|
||||||
function give_initial_stuff(player)
|
function give_initial_stuff(player)
|
||||||
if minetest.setting_getbool("give_initial_stuff") then
|
if minetest.setting_getbool("give_initial_stuff") then
|
||||||
minetest.log("action", "Giving initial stuff to player "..player:get_player_name())
|
minetest.log("action", "Giving initial stuff to player "..player:get_player_name())
|
||||||
player:get_inventory():add_item('main', 'default:pick_wood')
|
local inv = player:get_inventory()
|
||||||
player:get_inventory():add_item('main', 'default:sword_wood')
|
inv:set_list("main", {})
|
||||||
player:get_inventory():add_item('main', 'default:torch 3')
|
inv:set_list("craft", {})
|
||||||
|
inv:add_item('main', 'default:pick_wood')
|
||||||
|
inv:add_item('main', 'default:sword_wood')
|
||||||
|
inv:add_item('main', 'default:torch 3')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_newplayer(give_initial_stuff)
|
minetest.register_on_newplayer(give_initial_stuff)
|
||||||
|
minetest.register_on_respawnplayer(give_initial_stuff)
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
default
|
default
|
||||||
dye
|
|
||||||
tnt
|
|
||||||
wool
|
|
||||||
mobs?
|
mobs?
|
||||||
|
|
Loading…
Reference in a new issue