Camas/mods/give_initial/init.lua
2017-05-15 19:49:05 -07:00

22 lines
538 B
Lua

--
-- Gives initial stuff
-- By Kaadmy, for Pixture
--
local give_initial_enable = minetest.setting_getbool("give_initial_enable")
local give_initial_items = util.split(minetest.setting_get("give_initial_items"), ",")
local function on_newplayer(player)
if give_initial_enable then
local inv = player:get_inventory()
for _, itemstring in ipairs(give_initial_items) do
inv:add_item("main", itemstring)
end
end
end
minetest.register_on_newplayer(on_newplayer)
default.log("mod:give_initial", "loaded")