uBiT Posted February 5, 2012 Posted February 5, 2012 Hello, is it possible to play sound using function playSound() for all players in the server? If yes, how?
Kenix Posted February 5, 2012 Posted February 5, 2012 (edited) Server triggerClientEvent( 'playSound',root ) Client addEvent( 'playSound',true ) addEventHandler( 'playSound',root, function( ) playSound( ... ) -- ... arguments end ) Edited February 5, 2012 by Guest
GanJaRuleZ Posted February 5, 2012 Posted February 5, 2012 This works only for local player... False , false , and again false .. for _ in pairs( getElementsByType 'player' ) do This line will make the sound for all players
uBiT Posted February 5, 2012 Author Posted February 5, 2012 Yes i know, it has to be working, but it dont works. I can hear sound, but my friends cant.
50p Posted February 5, 2012 Posted February 5, 2012 playSound is a client-side function and only player who called this function will hear the sound. You have to tell the server (triggerServerEvent) to tell all the clients (triggerClientEvent) to play the sound.
uBiT Posted February 5, 2012 Author Posted February 5, 2012 playSound is a client-side function and only player who called this function will hear the sound. You have to tell the server (triggerServerEvent) to tell all the clients (triggerClientEvent) to play the sound. Thanks, working now
50p Posted February 5, 2012 Posted February 5, 2012 You're welcome. It's good to hear that you could manage to do it yourself. That makes me happy when people actually fix things without being given any code, just instructions. 1
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