Jump to content

AJUDA COM LEVEL


Recommended Posts

Posted
		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

  • Other Languages Moderators
Posted

Acho que ele quis dizer isso:

if lvl > 10 and Panel == 1 then

 

Posted

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

Posted (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 by LucasMTA
Posted

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

 

  • Other Languages Moderators
Posted
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

 

Posted

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

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