Jump to content

about PlaySound


SkatCh

Recommended Posts

Posted

guys i need some help i create a table and i want just those players will hear the sound ,

server :

for _, p in ipairs (CrTable) do 
                textDisplayRemoveObserver(Display, p) 
                triggerClientEvent("playMyMusic",p) 
                end 

and iside the client file i add the PlaySound . the text is working fine and the triggerClientEvent i think that there is something wrong.

i'm sorry about my english.

Posted
Post your full code so we can understand your problem even better.

it's just a part from my code just i need to make the players inside the tabe can hear the sound that's all .

i already change it to root but all players inside the server hear it.

Posted

here u go

addEvent("playMyMusic",true) 
addEventHandler("playMyMusic", getRootElement(),  
function() 
local sound = playSound("music.wav",false)  
setSoundVolume(sound, 1.0) 
end) 

Posted
addEvent("playMyMusic",true) 
addEventHandler("playMyMusic", getRootElement(), 
function() 
outputChatBox("Test") 
local sound = playSound("music.wav",false) 
setSoundVolume(sound, 1.0) 
end) 

see if it output 'Test' in the chat.

Posted

How about this?

for _, p in ipairs (CrTable) do 
                outputChatBox("Test - Server", p) 
                textDisplayRemoveObserver(Display, p) 
                triggerClientEvent(p,"playMyMusic",p) 
                end 

Posted

bro what about this i have an other idea i will change playsound with playSound3D and i will change P with root , because i already test it with root and i can hear the sound.

Posted

What kind of data you have in the table CrTable?

Can you post the code where you insert data on the table?

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...