Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
r = {}
local q = {}
local id
r.start = function(p, name)
id = #q + 1
local l = math.random(0, 4) + math.random()
minetest.chat_send_player(name, l)
local pitch_increase = math.random() * 0.1 + 0.125
q[id] = minetest.sound_play("fire_small", {fade = 1.0, gain = 0.39, pitch = 0.9 + pitch_increase, object = p, loop = true, offset = l})
local flange = minetest.sound_play("fire_small", {gain = 0.19, pitch = 0.9 + pitch_increase, object = p, loop = true, offset = l - 0.05})
minetest.sound_fade(flange, 0.1, 0.0)
minetest.sound_fade(q[id], -0.01, 0.2)
minetest.after(5 - l - 0.25, function()
local hf = minetest.sound_play("fire_small", {fade = 0.0, gain = 29, pitch = 0.98 + pitch_increase, object = p, loop = true, offset = 6})
minetest.sound_fade(hf, -0.6, 0)
minetest.sound_stop(q[id])
q[id] = nil
r.start(p, name)
end)
end
minetest.register_on_joinplayer(function(player)
r.start(player, player:get_player_name())
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.