View Single Post
Old 11-01-2017   #3
-CG7244-
ewe''
 
-CG7244-'s Avatar
Default

Or, you can do that in Lua:

Code:
addHook("ThinkFrame", function(p)
    for p in players.iterate
	    if p.mo and p.mo.skin == "knuckles" --character that will play the sound
		
		    if not P_PlayerInPain(p)
			    p.readytodosound = 1
				p.dosound = 0
			elseif p.readytodosound
                p.dosound = 1
				p.readytodosound = 0
			else
                p.dosound = 0
			end
            
            if p.dosound
                S_StartSound(p.mo, sfx_buzz3)			
			end
		end
	end
end)
"sfx_buzz3" is the sound that will be played, and to make it play once, you need to make a custom variable like I did.

P_PlayerDoPain, is the action when the player gets hurt.

EDIT: You always need to use the "sfx_" to use a sound, example, if you want to use the sound "DSBUZZ3" , you will write "sfx_buzz3" I mean, without the "DS", also, can be any sound, including custom ones. I hope this helped you.

Anyway, remember, if you want to use it with another character, replace "knuckles" with the character's SKIN NAME like: "skinname" .
__________________
Quote:
<CG7244> We spriters can see EACH DETAIL
My wad page: https://sites.google.com/view/carloswadjunk

Last edited by -CG7244-; 11-01-2017 at 11:31 PM.
-CG7244- is offline   Reply With Quote