uBiT Posted February 5, 2012 Share Posted February 5, 2012 Hello, is it possible to play sound using function playSound() for all players in the server? If yes, how? Link to comment
Kenix Posted February 5, 2012 Share 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 Link to comment
uBiT Posted February 5, 2012 Author Share Posted February 5, 2012 This works only for local player... Link to comment
GanJaRuleZ Posted February 5, 2012 Share 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 Link to comment
uBiT Posted February 5, 2012 Author Share Posted February 5, 2012 Yes i know, it has to be working, but it dont works. I can hear sound, but my friends cant. Link to comment
50p Posted February 5, 2012 Share 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. Link to comment
uBiT Posted February 5, 2012 Author Share 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 Link to comment
50p Posted February 5, 2012 Share 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 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