diff --git a/init.lua b/init.lua index 9283798..d5fc134 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,8 @@ +minetest.register_privilege("setblock", { + description = "Player can use place and setblock command.", + give_to_singleplayer= false, +}) + local function split (inputstr, sep) if sep == nil then sep = "%s" @@ -12,7 +17,7 @@ end minetest.register_chatcommand("place", { params = " ", description = "Place block", - privs = {creative = true}, + privs = {setblock = true}, func = function(name, param) splited = split(param," ") if not(tonumber(splited[1]) and tonumber(splited[2]) and tonumber(splited[3])) then @@ -33,7 +38,7 @@ minetest.register_chatcommand("place", { minetest.register_chatcommand("place_here", { params = "", - privs = {creative = true}, + privs = {setblock = true}, description = "Place block at player's pos", func = function(name, param) local player = minetest.get_player_by_name(name) @@ -56,7 +61,7 @@ minetest.register_chatcommand("place_here", { minetest.register_chatcommand("setblock", { params = " ", - privs = {creative = true}, + privs = {setblock = true}, description = "Set a block", func = function(name, param) splited = split(param," ") @@ -78,7 +83,7 @@ minetest.register_chatcommand("setblock", { minetest.register_chatcommand("setblock_here", { params = "", - privs = {creative = true}, + privs = {setblock = true}, description = "Set a block at player's pos", func = function(name, param) local player = minetest.get_player_by_name(name)