LiOneLMeSsIShoT Posted July 15, 2013 Posted July 15, 2013 I made this script to set Levels in Label i made in panel if the another label shows 100 Points....but when i earned 100...Not Showed Level: 1...only Stand in Level: 0 ..please help Client: function WeaponLevels (player, weapon) local Weapon = guiGetText(GUIEditor.label[2]) if Weapon then local Point = tonumber(Weapon) if Point == 100 and weapon == 22 then guiSetText (GUIEditor.label[3],"Level: 1") end end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels)
LiOneLMeSsIShoT Posted July 15, 2013 Author Posted July 15, 2013 can post full code? I can to post the only the Original Labels.. label [2] GUIEditor.label[2] = guiCreateLabel(80, 52, 87, 17, "Points: 0", false, GUIEditor.tab[1]) Label [3] GUIEditor.label[3] = guiCreateLabel(80, 71, 88, 21, "Level: 0", false, GUIEditor.tab[1]) any thing from the script you want to get tell me...but sorry can't post the full script
itoko Posted July 15, 2013 Posted July 15, 2013 Try this: function WeaponLevels (player, weapon) local Weapon = guiGetText(GUIEditor.label[2]) if Weapon then local Point = tonumber(Weapon) if Point >= 100 and weapon == 22 then guiSetText (GUIEditor.label[3],"Level: 1") end end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels) because you maybe haven't 100 points, but more
Castillo Posted July 15, 2013 Posted July 15, 2013 That doesn't really make much sense, "onClientRender" has no parameters.
itoko Posted July 15, 2013 Posted July 15, 2013 Ah yes, my bad, i didn't check the whole code at all, which is a big mistake ^^'. I guess the event should be onZombieWasted. (from what i know you're working on)
LiOneLMeSsIShoT Posted July 15, 2013 Author Posted July 15, 2013 Try this: function WeaponLevels (player, weapon) local Weapon = guiGetText(GUIEditor.label[2]) if Weapon then local Point = tonumber(Weapon) if Point >= 100 and weapon == 22 then guiSetText (GUIEditor.label[3],"Level: 1") end end end addEventHandler( "onClientRender",getRootElement(), WeaponLevels) because you maybe haven't 100 points, but more I'm tested it...the same thing...gimme an error : attempt to compare number with nil Please help
LiOneLMeSsIShoT Posted July 16, 2013 Author Posted July 16, 2013 say line error and post full whole Script code I can't just post my Full script in the forum for public...i hope you understand me......and the line error is: attempt to compare number with nil that's what i got from the debug script!...and THANKS For helping
iMr.3a[Z]eF Posted July 16, 2013 Posted July 16, 2013 if it's private script send it to me private message then i'll try my best to help you.
LiOneLMeSsIShoT Posted July 16, 2013 Author Posted July 16, 2013 if it's private script send it to me private message then i'll try my best to help you. Skype: lionelmessishoter
فاّرس Posted July 16, 2013 Posted July 16, 2013 You want if points = 100 and weapon = 22 ?? for weapon use : getPedWeapon i mean : local weapon = getPedWeapon(localPlayer) if weapon == 22 then -- Your code if the answer yes < try : addEventHandler( "onClientRender",root, function() local Weapon = guiGetText(GUIEditor.label[2]) if Weapon then local Point = tonumber(Weapon) if Point == 100 and getPedWeapon(localPlayer) == 22 then guiSetText (GUIEditor.label[3],"Level: 1") end end end )
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