diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -168,10 +168,16 @@ creative_inventory.clear_inventory = function(player) minetest.chat_send_player(player_name, 'Inventory Cleared!') end creative_inventory.creative_on = function(player) - minetest.set_player_privs(player:get_player_name(),{creative=true}) + local name = player:get_player_name() + local privs = minetest.get_player_privs(name) + privs["creative"] = true + minetest.set_player_privs(name,privs) end creative_inventory.creative_off = function(player) - minetest.set_player_privs(player:get_player_name(),{creative=false}) + local name = player:get_player_name() + local privs = minetest.get_player_privs(name) + privs["creative"] = false + minetest.set_player_privs(name,privs) end minetest.register_on_joinplayer(function(player) -- If in creative mode, modify player's inventory forms |