diff options
author | cheapie <no-email-for-you@example.com> | 2014-08-07 00:58:47 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2014-08-07 00:58:47 -0500 |
commit | be6fed9c20db173f0fed01528a0822f23eb62c4f (patch) | |
tree | e1de5fd94d5ecd2370d6338fb5c709c3e86b1a46 /init.lua | |
parent | 159ff8d1afcdbaeb682de8998119baa8a6d9fbd0 (diff) | |
download | creative-master.tar creative-master.tar.gz creative-master.tar.bz2 creative-master.tar.xz creative-master.zip |
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 |