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 ( 'sound1', money )
sound = playSound ( "1.mp3", false )
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
)