XxCozzaxX Posted April 6, 2010 Share Posted April 6, 2010 I tried to use this function and failed - addEventHandler("onPlayerWasted", root, function() local sound = playSound("sounds/wasted.mp3") --Play Fix up look sharp-Dizzee Rascal.mp3 from the sounds folder setSoundVolume(sound, 0.5) -- set the sound volume to 50% end ) Why isnt it playing the sound when i die? Link to comment
DakiLLa Posted April 6, 2010 Share Posted April 6, 2010 playSound is a client-side function, but you have used it server-side, thats wrong. Use onClientPlayerWasted event instead of 'onPlayerWasted'. addEventHandler("onClientPlayerWasted", getLocalPlayer(), function() local sound = playSound("sounds/wasted.mp3") --Play Fix up look sharp-Dizzee Rascal.mp3 from the sounds folder setSoundVolume(sound, 0.5) -- set the sound volume to 50% end ) Link to comment
XxCozzaxX Posted April 6, 2010 Author Share Posted April 6, 2010 So your saying this should work? addEventHandler("onClientPlayerWasted", root, function() local sound = playSound("sounds/wasted.mp3") --Play Fix up look sharp-Dizzee Rascal.mp3 from the sounds folder setSoundVolume(sound, 0.5) -- set the sound volume to 50% end ) EDIT: Nope Your one will though! 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