Jump to content

Erro guiSetText


Lyn

Recommended Posts

Posted

Boa tarde, a todos!

Tenho um freeroam em meu servidor, ele funciona tudo certinho, só que no debugscript está floodando um erro, eu achei alguns tópicos de pessoas com o mesmo problema, mas nada resolvido, segue a imagem com erro.

Tk7U7m3.png

Essa é a linha do arquivo gui.lua, onde está causando o erro:

function setControlNumber(...)
	local args = {...}
	local num = table.remove(args)
	guiSetText(getControl(unpack(args)), tostring(num))
end

Por gentileza, alguém teria a solução?

Muito obrigado!

Posted

Use uma verificação pra saber se o elemento-GUI existe:

function setControlNumber(...)
	local args = {...}
	local num = table.remove(args)
	if getControl(unpack(args)) then
		guiSetText(getControl(unpack(args)), tostring(num))
	end
end

 

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

Posted

getControl por algum motivo retorna o valor booleano false que por sua vez causa esse erro quando usado em guiSetText.

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

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