• Sounds keep repeating.
    10 replies, posted
[code]local function PlayerDeathSound() -- That doesn't work and it doesn't mute original death sound. return false end hook.Add("PlayerDeath","Penis jokes are funny",OnPlayerDeath) local function PlayerHurt(ply, healthRemaining) if GetConVarNumber( "kp_hurtsounds" ) == 1 then if ply:Health() < 100 then ply:EmitSound("kp/male/pain100_"..math.random(1,2)..".wav") elseif ply:Health() < 75 then return false end if ply:Health() < 75 then -- If you're hurt, it plays this sound and the one before. ply:EmitSound("kp/male/pain75_"..math.random(1,2)..".wav") elseif ply:Health() < 50 then return false end if ply:Health() < 50 then -- If you're hurt, it plays this sound and the two ones before. ply:EmitSound("kp/male/pain50_"..math.random(1,2)..".wav") elseif ply:Health() < 25 then return false end if ply:Health() < 25 then -- If you're hurt, it plays this sound and the three ones before. ply:EmitSound("kp/male/pain25_"..math.random(1,2)..".wav") if ply:IsOnFire( ) then ply:EmitSound("kp/male/flamedeath"..math.random(1,3)..".wav") -- If you're hurt and on fire, it plays death sounds above + spams this one. elseif GetConVarNumber( "kp_hurtsounds" ) == 2 then -- Same here. if ply:Health() < 100 then ply:EmitSound("kp/female/pain100_"..math.random(1,2)..".wav") elseif ply:Health() < 75 then return false end if ply:Health() < 75 then -- If you're hurt, it plays this sound and the one before. ply:EmitSound("kp/female/pain75_"..math.random(1,2)..".wav") elseif ply:Health() < 50 then return false end if ply:Health() < 50 then -- If you're hurt, it plays this sound and the two ones before. ply:EmitSound("kp/female/pain50_"..math.random(1,2)..".wav") elseif ply:Health() < 25 then return false end if ply:Health() < 25 then -- If you're hurt, it plays this sound and the three ones before. ply:EmitSound("kp/female/pain25_"..math.random(1,2)..".wav") if ply:IsOnFire( ) then ply:EmitSound("kp/female/flamedeath"..math.random(1,3)..".wav") -- If you're hurt and on fire, it plays death sounds above + spams this one. end end end end end end hook.Add("PlayerHurt","crapshit",PlayerHurt)[/code]
Describe the fucking problem. Also, [code] local function PlayerDeathSound() -- That doesn't work and it doesn't mute original death sound. return false end hook.Add("PlayerDeath","jokes are for morons",OnPlayerDeath)[/code] You used wrong hook name, Matt posted the correct hook to use in your previous thread. [editline]13th January 2014[/editline] And you add hook for a different function. Oh god. PLEASE LEARN HOW TO CODE and some COMMON SENSE before posting and asking for help.
What about repeating sounds?
[QUOTE=I'm great;43521336]What about repeating sounds?[/QUOTE] Give up. If you dont read, copying others code wont get you anywhere.
[QUOTE=Matsilagi;43521708]Give up. If you dont read, copying others code wont get you anywhere.[/QUOTE] Thanks, but I wrote most of it myself. Also it's rather rattish to remove and block me but keep doing stuff like you did just now.
I've commented everything that's not working.
Bump.
[video=youtube;FxGaETSGZpc]http://www.youtube.com/watch?v=FxGaETSGZpc&feature=youtu.be[/video] Is this even possible to fix? :v:
Put delay before a new sound can be played.
Sorry, you need to Log In to post a reply to this thread.