Jump to content

help again


Paplo

Recommended Posts

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

xD

addEvent("test2", true) 
addEventHandler("test2",getRootElement(), 
function () 
                    triggerClientrEvent ( 'test' ) 
end 
) 

Link to comment
  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

xD

addEvent("test2", true) 
addEventHandler("test2",getRootElement(), 
function () 
                    triggerClientrEvent ( 'test' ) 
end 
) 

Mr.Pres[T]ege has solved the problem, try his code

Link to comment
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 xD

Link to comment
@ 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 :lol:

@Paplo: what is the debug in Console?

write debugscript 3 in F8 "Console"

Link to comment
@ 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
@ 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 :lol:

@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

xD

true?

Link to comment
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

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
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 by Guest
Link to comment
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

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