Jump to content

ERRO COM RANK


Recommended Posts

Error: rANKSYSTEM:CLIENT.lua:8 bad argument #1 to 'format' [number expected, got nill )
return tonumber(("%."..decimals.."f"):format(number))

 

Esse erro é causado quando tem alguns jogadores ONLINE sozinho não acontece !

Toda a função do erro:

--/-- RATIO DIMINUIÇÃO DAS CASAS
function math.round(number, decimals, method)
    decimals = decimals or 0
    local factor = 10 ^ decimals
    if (method == "ceil" or method == "floor") then
		return math[method](number * factor) / factor
    else
		return tonumber(("%."..decimals.."f"):format(number))
	end
end

 

Edited by OverKILL
Link to comment

Talvez isso corrija a mensagem no debug:


function math.round(number, decimals, method)
	if number and type(number) == "number" then
		decimals = decimals or 0
		local factor = 10 ^ decimals
		if (method == "ceil" or method == "floor") then
			return math[method](number * factor) / factor
		else
			return tonumber(("%."..decimals.."f"):format(number))
		end
	end
	return 0
end
  • Like 1
Link to comment
4 minutes ago, DNL291 said:

Talvez isso corrija a mensagem no debug:


function math.round(number, decimals, method)
	if number and type(number) == "number" then
		decimals = decimals or 0
		local factor = 10 ^ decimals
		if (method == "ceil" or method == "floor") then
			return math[method](number * factor) / factor
		else
			return tonumber(("%."..decimals.."f"):format(number))
		end
	end
	return 0
end

Obrigado em breve irei testar! a DNL pode ver privado por favor? quero uma ajuda mas não quero divulgar o código publicamente !

Link to comment

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