LucasMTA Posted May 20, 2019 Share Posted May 20, 2019 local lvl = getElementData(localPlayer, "player:level" ) or 0 local xp = getElementData(localPlayer, "player:xp" ) or 0 if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then if Panel == 1 then valor = 1 texto = 'Eroina' end end -------------------------------------------------------------------------------- tentei dessa forma local lvl = getElementData(localPlayer, "level" ) or 0 local xp = getElementData(localPlayer, "xp" ) or 0 if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then if level > 10 and Panel == 1 then valor = 1 texto = 'Eroina' end end eu estou tentando colocar nivel para cada botao mais nao estou conseguindo oque estou fazendo errado eu tentei assim mais nao foi Link to comment
#DeltaSCR Posted May 20, 2019 Share Posted May 20, 2019 Onde voce declara o que é "Level"? Link to comment
Other Languages Moderators Lord Henry Posted May 20, 2019 Other Languages Moderators Share Posted May 20, 2019 Acho que ele quis dizer isso: if lvl > 10 and Panel == 1 then Link to comment
Jonas^ Posted May 20, 2019 Share Posted May 20, 2019 (edited) Esse Panel == 1 ai não seria Panel == true ? Edited May 20, 2019 by Jonas^ Link to comment
LucasMTA Posted May 20, 2019 Author Share Posted May 20, 2019 Desculpa eu coloquei level era lvl Jonas é porque tem varios paineis tipo Panel == 2 , Panel == 3 Link to comment
LucasMTA Posted May 20, 2019 Author Share Posted May 20, 2019 tentei adicionar um if dentro de outro if , elseif mais nao consegui ele da erro no valor acho que quando coloco lvl > xxx antes ele nao indentifica o Panel == xxx Link to comment
LucasMTA Posted May 20, 2019 Author Share Posted May 20, 2019 (edited) Jonas deu certo dessa forma que eu falei, mais o texto = não funciona , esse texto eu define pra cada panel e define fora do if com um output mais da erro global local lvl = getElementData(localPlayer, "player:level" ) if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then if lvl > 10 and currentPanel == 1 then valor = 1 texto = "teste" elseif lvl > 11 and currentPanel == 2 then valor = 2 texto = "teste" elseif lvl > 12 and currentPanel == 3 then valor = 3 texto = "teste" elseif lvl > 13 and currentPanel == 4 then valor = 4 texto = "teste" elseif lvl > 14 and currentPanel == 4 then valor = 5 texto = "teste" else outputChatBox("Nivel insuficiente para comprar "..texto.."", 255,255,255,true) end erro : attempt to concatenate global "texto" (a nil value) Edited May 20, 2019 by LucasMTA Link to comment
Jonas^ Posted May 20, 2019 Share Posted May 20, 2019 Sem código fica difícil .. Ué, é o mesmo botao pra tudo? if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then Link to comment
Other Languages Moderators Lord Henry Posted May 20, 2019 Other Languages Moderators Share Posted May 20, 2019 local lvl = getElementData(localPlayer, "player:level" ) if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then local texto = "teste0" if lvl > 10 and currentPanel == 1 then valor = 1 texto = "teste1" elseif lvl > 11 and currentPanel == 2 then valor = 2 texto = "teste2" elseif lvl > 12 and currentPanel == 3 then valor = 3 texto = "teste3" elseif lvl > 13 and currentPanel == 4 then valor = 4 texto = "teste4" elseif lvl > 14 and currentPanel == 4 then valor = 5 texto = "teste5" else outputChatBox("Nivel insuficiente para comprar "..texto, 255, 255, 255) end end Link to comment
LucasMTA Posted May 20, 2019 Author Share Posted May 20, 2019 Sim jonas é o mesmo botao mais com diferentes Paineis Lord eu fiz dessa forma nao sei porque nao funcionou, mais da forma que voce feiz deu certo .-. Link to comment
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