Machine Posted June 21, 2012 Posted June 21, 2012 hey i have created gui but theres something nor working in it Client addEventHandler("onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then triggerServerEvent ( "lol", getLocalPlayer() ) server addEvent( "lol", true ) addEventHandler ( "lol", getRootElement(), song ) function lol ( song ) song = playSound3D("song.mp3", -471.60000610352, -547.79998779297, 24.39999961853, false) end
Kenix Posted June 21, 2012 Posted June 21, 2012 hey i have created gui but theres something nor working in itClient addEventHandler("onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then triggerServerEvent ( "lol", getLocalPlayer() ) You forgot 'end' and ')' server addEvent( "lol", true ) addEventHandler ( "lol", getRootElement(), song ) function lol ( song ) song = playSound3D("song.mp3", -471.60000610352, -547.79998779297, 24.39999961853, false) end It's totally wrong.
Wei Posted June 21, 2012 Posted June 21, 2012 addEventHandler("onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor_Button[2] ) then song = playSound3D("song.mp3", -471.60000610352, -547.79998779297, 24.39999961853, false) end end ,true)
Machine Posted June 21, 2012 Author Posted June 21, 2012 Machine i already know that problem is when you start thats and cous its client only the player who prees button can hear it but i must make it server so everyone can hear it and of cours the player who started it
Wei Posted June 21, 2012 Posted June 21, 2012 (edited) Try. I never tryed this way... addEventHandler("onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor_Button[2] ) then triggerEvent ( "playEvent", getRootElement()) end end ,true) addEvent ( "playEvent", true ) function playEvent () song = playSound3D("song.mp3", -471.60000610352, -547.79998779297, 24.39999961853, false) end addEventHandler ( "playEvent", getRootElement(), playEvent ) Edited June 21, 2012 by Guest
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