diff --git a/init.lua b/init.lua index acff3a4..591258a 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,8 @@ -- GPL3+ gen_music = {} local se = minetest.request_insecure_environment() -local show_st = minetest.settings:get_bool("show_sound_travelers") +local settings = minetest.settings +local show_st = settings:get_bool("show_sound_travelers") gen_music.songs = {} local mod_name = minetest.get_current_modname() @@ -317,10 +318,16 @@ gen_music.gs = function(object, song, loop) end) end +-- Restrict usage until further testing has been done. +minetest.register_privilege("game_sounds", { + description = "Can use /gs command.", + give_to_singleplayer = true, + give_to_admin = true, +}) minetest.register_chatcommand("gs", { description = "Play and load game sound sequences.", params = "[load ] [list] [stop] [song ]", - privs = nil, --"game_sounds", + privs = "game_sounds", func = function(name, param) param = param:split(" ") local player = minetest.get_player_by_name(name)