• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help FIX Script Problem with round

We can probably guess, but please tell your TFS.. and explain the problem better?
Problem with Round. I have no idea what your talking about.. unless your talking about a loop, circle, or rounding the number up/down? idk .. :eek:
 
We can probably guess, but please tell your TFS.. and explain the problem better?
Problem with Round. I have no idea what your talking about.. unless your talking about a loop, circle, or rounding the number up/down? idk .. :eek:
0.3.6

the error is this

:12: attemp t to call global roud (a nil value)
 
math.floor is rounding it. 'Round' itself has no explicit meaning.
Code:
local expLost = (math.floor(getPlayerExperience(cid) - getExperienceForLevel(LEVEL_MINIMUM)) / 7) * 2.5, 0
I'm not entirely certain what the 0 at the end is for though.

Scratch everything above.
It looks like wherever you copied this from is using things that are never registered?
Round is never registered.
LEVEL_MINIMUM is never registered.

I have no idea what's going on.
 
You can add this to your function lib file, which is data/lib/050-function.lua in TFS 0.3.6.
Code:
function round(num, idp)
     local mult = 10^(idp or 0)
     return math.floor(num * mult + 0.5) / mult
end

If you have errors, always good to post the full error or a screenshot of it so people can see what exactly the problem is.
 
Back
Top