-- Play sound on command
-- put sound file to mod_path/sounds/hwmod_horn.ogg

minetest.register_chatcommand("foo", {
    privs = {
        interact = true,
    },
    func = function(name, param)
    	local player = minetest.get_player_by_name(name)
    	minetest.sound_play("hwmod_horn", {
            pos = player.pos,
            max_hear_distance = 20,
            gain = 1.0,
        })
        return true, "You said " .. param .. "!"
    end,
})

Изменить пасту