diff options
Diffstat (limited to 'advtrains/signals.lua')
-rw-r--r-- | advtrains/signals.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/advtrains/signals.lua b/advtrains/signals.lua index 62b9f03..a42f5e7 100644 --- a/advtrains/signals.lua +++ b/advtrains/signals.lua @@ -225,3 +225,19 @@ minetest.register_node("advtrains:across_on", { end end, }) + +minetest.register_abm( + { + label = "Sound for Level Crossing", + nodenames = {"advtrains:across_on"}, + interval = 3, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.sound_play("advtrains_crossing_bell", { + pos = pos, + gain = 1.0, -- default + max_hear_distance = 16, -- default, uses an euclidean metric + }) + end, + } +) |