summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2014-08-07 00:58:47 -0500
committercheapie <no-email-for-you@example.com>2014-08-07 00:58:47 -0500
commitbe6fed9c20db173f0fed01528a0822f23eb62c4f (patch)
treee1de5fd94d5ecd2370d6338fb5c709c3e86b1a46
parent159ff8d1afcdbaeb682de8998119baa8a6d9fbd0 (diff)
downloadcreative-be6fed9c20db173f0fed01528a0822f23eb62c4f.tar
creative-be6fed9c20db173f0fed01528a0822f23eb62c4f.tar.gz
creative-be6fed9c20db173f0fed01528a0822f23eb62c4f.tar.bz2
creative-be6fed9c20db173f0fed01528a0822f23eb62c4f.tar.xz
creative-be6fed9c20db173f0fed01528a0822f23eb62c4f.zip
Modify /just/ the creative priv, not all of themHEADmaster
-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