MrMessyHair
Noob in BLua
Hello, I want to know how to make a sound play only when something happens, and automatically stops when it's not ocurring. In this case, when the player gets invincibility.
Here is the code if somebody asks.
Here is the code if somebody asks.
freeslot("sfx_inv")
sfxinfo[sfx_inv].caption = "Sparlkes"
addHook("PlayerThink", function(player)
if player.mo then
if (player.powers[pw_invulnerability])
if not S_SoundPlaying(player.mo, sfx_inv)
S_StartSound(player.mo, sfx_inv)
end
end
end
end)
Last edited: