Machine Posted June 21, 2012 Share 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 Link to comment
Kenix Posted June 21, 2012 Share 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. Link to comment
Wei Posted June 21, 2012 Share 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) Link to comment
Machine Posted June 21, 2012 Author Share 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 Link to comment
Wei Posted June 21, 2012 Share 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 Link to comment
Kenix Posted June 21, 2012 Share Posted June 21, 2012 Variable rootElement is not defined. 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