Jump to content

Script Errors..help


Recommended Posts

Posted
at 116 be sure that the label name is correct
        GUIEditor.label[2] = guiCreateLabel(80, 52, 87, 17, "Points: 0", false, GUIEditor.tab[1]) 

It's the Label...Correct right?

look Nevermind about this script problem...it's because i was puted guisetVisible... it was making A lot of ERRORS...

The Problem now with :123: and :124:

codes:

:123:

:123:Bad Argument @ 'getPedStat' 

:124:

:124:attempt to compare nil with number 

Posted

Make sure the killer is a player element and not a nil/false value.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
function WeaponLevels (killer, weapon) 
    if killer then 
     
    local Nothing = getPedStat(killer, 69) 
        if Nothing <= 100 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 1") 
        elseif Nothing <= 200 and Nothing > 100 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 2") 
        elseif Nothing <= 300 and Nothing > 200 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 3") 
        elseif Nothing <= 400 and Nothing > 300 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 4") 
        elseif Nothing <= 500 and Nothing > 400 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 5") 
        elseif Nothing <= 600 and Nothing > 500 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 6") 
        elseif Nothing <= 700 and Nothing > 600 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 7") 
        elseif Nothing <= 800 and Nothing > 700 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 8") 
        elseif Nothing <= 900 and Nothing > 800 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 9") 
        elseif Nothing <= 1000 and Nothing > 900 and weapon == 22 then 
            guiSetText (GUIEditor.label[3], "Level: 10") 
        end 
         
    else 
        outputChatBox("'killer' does not exist.") 
    end 
end 
addEventHandler( "onClientRender",getRootElement(), WeaponLevels) 

Try it.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

That makes totally no sense, "onClientRender" has no parameters.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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