• unable to play a sound to all players
    6 replies, posted
Hi guys, i'm trying to play a sound to all players but i can't seem to make it work :/ so this is what i'm doing: for _,ply in pairs(player.GetAll()) do                     ply:PlaySound( "PASystem/"..PAValue[1]..".ogg" )                 end
Theres no such thing as ply:PlaySound.
sorry wrong file for _,ply in pairs(player.GetAll()) do                     surface.PlaySound( "PASystem/"..PAValue[1]..".ogg" )                 end
Are you sure that this piece of code is on the client side? Also, can you please explain what do you trying to do?
i have made a derma with 4 DComboBox from wich i let the user select an option for each combobox then i put the result in a table (PAValue) and play the corresponding sounds.
What does the first 5 lines of code look like in your addon(client side)? Did you include resource.AddFile
If you're trying to make it so others hear a sound as well, you gotta network the changes. Learn about networking on the wiki. Basically it'd go this way. Client sends a net message to the server -> server receives it -> server sends message to all the clients -> clients receive the message and play the sound.
Sorry, you need to Log In to post a reply to this thread.