SkatCh Posted September 5, 2014 Posted September 5, 2014 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.
Ab-47 Posted September 5, 2014 Posted September 5, 2014 Post your full code so we can understand your problem even better.
SkatCh Posted September 5, 2014 Author Posted September 5, 2014 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.
SkatCh Posted September 5, 2014 Author Posted September 5, 2014 bro i already try it but did't work .
SkatCh Posted September 5, 2014 Author Posted September 5, 2014 here u go addEvent("playMyMusic",true) addEventHandler("playMyMusic", getRootElement(), function() local sound = playSound("music.wav",false) setSoundVolume(sound, 1.0) end)
TAPL Posted September 5, 2014 Posted September 5, 2014 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.
SkatCh Posted September 5, 2014 Author Posted September 5, 2014 i tried it nothing i can't see Test in chatbox
TAPL Posted September 5, 2014 Posted September 5, 2014 How about this? for _, p in ipairs (CrTable) do outputChatBox("Test - Server", p) textDisplayRemoveObserver(Display, p) triggerClientEvent(p,"playMyMusic",p) end
SkatCh Posted September 5, 2014 Author Posted September 5, 2014 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.
TAPL Posted September 5, 2014 Posted September 5, 2014 What kind of data you have in the table CrTable? Can you post the code where you insert data on the table?
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