This commit is contained in:
DonBatman 2016-03-23 04:59:59 -07:00
parent 4e409bc5b2
commit c60bc0eae9

View File

@ -1,4 +1,5 @@
local player_name = {}
local sound = "no"
local mysounds = { -- block name, sound
{"months","mymonths_thunder"}
@ -84,12 +85,16 @@ minetest.register_chatcommand("hidesoundblock", {
end
})
local play_sound = function()
if sound == "no" then
return
else
minetest.sound_play(sound, {
max_hear_distance = 10,
to_player = player,
gain = 1.0,
})
end
end
end
minetest.register_abm({
nodenames = {"mysoundblocks:block_hidden_"..sname},
@ -104,6 +109,7 @@ minetest.register_abm({
local pf = function()
local n = minetest.find_node_near(pos, 5,"mysoundblocks:block_hidden_"..sname)
player_name[p] = false
sound = "yes"
end
if player_name[p] == nil then
player_name[p] = true