Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 server addEvent("test2", true) addEventHandler("test2",getRootElement(), function () triggerClientrEvent ( 'test' ) end end ?????? you did not do what I told you and trigger is mistake in writing addEvent("test2", true) addEventHandler("test2",getRootElement(), function () triggerClientrEvent ( 'test' ) end ) Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 @ Mr.Pres[T]ege: may i ask?| why you put false in playSound while in wiki didn't write that? and is this code fine? sound = playSound ( "1.mp3" ) Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 server addEvent("test2", true) addEventHandler("test2",getRootElement(), function () triggerClientrEvent ( 'test' ) end end ?????? you did not do what I told you and trigger is mistake in writing addEvent("test2", true) addEventHandler("test2",getRootElement(), function () triggerClientrEvent ( 'test' ) end ) Mr.Pres[T]ege has solved the problem, try his code Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 Try this :-- Client Side -- local lastTick = 0 -- Define a variable with the last tick count local toWait = 60000 -- Define a variable with the time needed to wait local Group = { { 100000 }, } addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.staticimage[2] ) then local money = 0 if ( source == GUIEditor.staticimage[2] ) then money = Group[1][1] end if ( getTickCount ( ) - lastTick >= toWait ) then -- Calculate how long it passed since last used and compare with required time to wait. if ( getPlayerMoney ( ) >= tonumber ( money ) ) then triggerServerEvent('SyncSound',localPlayer) lastTick = getTickCount ( ) else outputChatBox ( 'You Not Have Money', 255, 0, 0 ) end else outputChatBox ( "You must wait 60 seconds to use it again!", 255, 0, 0 ) end end end ) addEvent('ClientSyncSound',true) addEventHandler('ClientSyncSund',root, function ( ) if isElement ( sound ) then destroyElement ( sound ) sound = nil end sound = playSound ( "1.mp3", false ) end ) -- Server Side -- addEvent('SyncSound',true) addEventHandler('SyncSound',root, function ( ) triggerClientEvent ('ClientSyncSound',root) end ) not working Link to comment
iPrestege Posted June 19, 2013 Share Posted June 19, 2013 @ Mr.Pres[T]ege: may i ask?| why you put false in playSound while in wiki didn't write that?and is this code fine? sound = playSound ( "1.mp3" ) element playSound ( string soundPath, [ bool looped = false ] ) Read the wiki . @ Paplo: debugscript 3 Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 @ Mr.Pres[T]ege: may i ask?| why you put false in playSound while in wiki didn't write that?and is this code fine? sound = playSound ( "1.mp3" ) element playSound ( string soundPath, [ bool looped = false ] ) Read the wiki . @ Paplo: debugscript 3 oh lol all time fasle @Paplo: what is the debug in Console? write debugscript 3 in F8 "Console" Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 @ Mr.Pres[T]ege: may i ask?| why you put false in playSound while in wiki didn't write that?and is this code fine? sound = playSound ( "1.mp3" ) element playSound ( string soundPath, [ bool looped = false ] ) Read the wiki . @ Paplo: debugscript 3 not have error But I do not hear the sound Why? Link to comment
iPrestege Posted June 19, 2013 Share Posted June 19, 2013 Are you sure about the meta the file is exists ? Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 @ Mr.Pres[T]ege: may i ask?| why you put false in playSound while in wiki didn't write that?and is this code fine? sound = playSound ( "1.mp3" ) element playSound ( string soundPath, [ bool looped = false ] ) Read the wiki . @ Paplo: debugscript 3 oh lol all time fasle @Paplo: what is the debug in Console? write debugscript 3 in F8 "Console" false = That works once a sound and then does not work true = The sound becomes repeated whenever ended true? Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 Are you sure about the meta the file is exists ? meta "Paplo" version="2" type="script" /> Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 looped: A boolean representing whether the sound will be looped. To loop the sound, use true. Loop is not available for streaming sounds, only for sound files. Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 Paplo it should work. Perhaps the player that compresses the image does not hear sound, but other players hear the sound i dont know : / Link to comment
iPrestege Posted June 19, 2013 Share Posted June 19, 2013 The player how click the image can't hear the sound? Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 The player how click the image can't hear the sound? lol you ment who? Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 I asked Paplo . i don't know i say Probably I will try tomorrow when wakes up my brother Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 addEvent('s1',true) addEventHandler('s1',root, function ( ) if isElement ( sound ) then destroyElement ( sound ) sound = nil end sound = playSound ( "1.mp3", false ) end ) Prestege ! i change name for event and work it thank you ^^ Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 But if the click players on the picture at the same time will sound twice Is there a way to make it waits 60 seconds if the first player click and then click the second player To hear the sound of the server for the first player and server says to the second to wait 60 seconds ? Link to comment
Paplo Posted June 19, 2013 Author Share Posted June 19, 2013 setTimer guiSetEnabled i hate this way can i use getTickCount ? Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 (edited) setTimer guiSetEnabled i hate this way can i use getTickCount ? its very simple setTimer ( function Enable() guiSetEnabled( element, false ) end, 60000, 1 ) addEventHandler ( "onClientGUIClick", element, Enable) element: the picture what you want to disable for 60 seconds sorry i've mistaked Edited June 19, 2013 by Guest Link to comment
iPrestege Posted June 19, 2013 Share Posted June 19, 2013 addEvent('ClientSyncSound',true) addEventHandler('ClientSyncSund',root, function ( ) guiSetEnabled ( GUIEditor.staticimage[2],false ) setTimer ( guiSetEnabled,60000,1,GUIEditor.staticimage[2],true ) if isElement ( sound ) then destroyElement ( sound ) sound = nil end sound = playSound ( "1.mp3", false ) end ) 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