mastermax777 Posted May 15, 2011 Share Posted May 15, 2011 sounds = { "back.wav", "death.wav", "pisses.wav" } function wasted (killer, weapon, bodypart) local randID = math.random ( 1, #sounds) local randomSound = sounds[randomID] local sound = playSound(randomSound) setSoundVolume(sound, 1.0) end no error , sound just doesn't play... pls help Link to comment
karlis Posted May 15, 2011 Share Posted May 15, 2011 (edited) randID and randomID isn't the same. also make sure filepaths are right. and you forgot to add handler. afaik setting sound loudness to 1.0 is not needed, it should be default, but not sure.if it fails, try setting it to 1.0 manually. but 1function less called is always nice. sounds = { "back.wav", "death.wav", "pisses.wav" } addEventHandler("onClientPlayerWasted",getLocalPlayer(), function() playSound(sounds[math.random(1,#sounds)]) end) Edited May 16, 2011 by Guest Link to comment
Castillo Posted May 16, 2011 Share Posted May 16, 2011 Ehm, karlis, onPlayerWasted event is only Server-sided, i think he should use onClientPlayerWasted instead . sounds = { "back.wav", "death.wav", "pisses.wav" } addEventHandler("onClientPlayerWasted",getLocalPlayer(), function() playSound(sounds[math.random(1,#sounds)]) end) Link to comment
karlis Posted May 16, 2011 Share Posted May 16, 2011 Ehm, karlis, onPlayerWasted event is only Server-sided, i think he should use onClientPlayerWasted instead . sounds = { "back.wav", "death.wav", "pisses.wav" } addEventHandler("onClientPlayerWasted",getLocalPlayer(), function() playSound(sounds[math.random(1,#sounds)]) end) doh, sorry for that Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now