add chest open/close sound

This commit is contained in:
tenplus1 2025-07-02 11:20:39 +01:00
commit 73bbe5fb95

View file

@ -148,6 +148,9 @@ core.register_node("protector:chest", {
.. "listring[current_player;main]" .. "listring[current_player;main]"
end end
core.sound_play("default_chest_open", {
gain = 0.3, pos = pos, max_hear_distance = 10}, true)
core.show_formspec(clicker:get_player_name(), core.show_formspec(clicker:get_player_name(),
"protector:chest_" .. core.pos_to_string(pos), formspec) "protector:chest_" .. core.pos_to_string(pos), formspec)
end, end,
@ -222,6 +225,10 @@ core.register_on_player_receive_fields(function(player, formname, fields)
meta:set_string("infotext", S("Protected Chest")) meta:set_string("infotext", S("Protected Chest"))
end end
elseif fields.quit then
core.sound_play("default_chest_close", {
gain = 0.3, pos = pos, max_hear_distance = 10}, true)
end end
end) end)