summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index ac3a3da..8c45e4a 100644
--- a/init.lua
+++ b/init.lua
@@ -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