Jump to content

help


golanu21

Recommended Posts

function greetingHandler ( ) 
Reached100 = 0 
guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
local mu = guiProgressBarGetProgress (progressBar) 
        if mu >= 100 then 
        guiProgressBarSetProgress(progressBar, 0) 
            print(Reached100 +1) 
            end 
                        if Reached100 == 2 then 
                            guiSetText(nivlab, "2") 
                            end 
                            if Reached100 == 3 then 
                            guiSetText(nivlab, "3") 
                            end 
end 
                     
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

i want when progressBar has reached 2 times 100% then guiSetText(nivlab, "text") :D is don't work

Link to comment
local progCount = 0 
  
function greetingHandler ( ) 
guiProgressBarSetProgress ( progressBar, ( guiProgressBarGetProgress ( progressBar ) + 50 ) ) 
local mu = guiProgressBarGetProgress (progressBar) 
    if mu >= 100 then 
        guiProgressBarSetProgress(progressBar, 0) 
        progCount = progCount+1 
    end 
    if progCount == 1 then -- if progress count is 1 
        guiSetText(nivlab, "1") 
    elseif progCount == 2 then 
        guiSetText(nivlab, "2") -- if progress count is 2 
    end 
end 
addEvent ( "gret", true ) 
addEventHandler ( "gret", getRootElement(), greetingHandler ) 

Try this

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