Jump to content

playsound


Recommended Posts

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

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

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 xD Your one will though!

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...