Khalil Posted September 12, 2013 Share Posted September 12, 2013 local x,y,z = getElementPosition (lp) guiSetText(memo,math.round(x,3)..","..math.round(y,3)..","..math.round(z,3)) Debug Script says: "attempt to call field 'round' a nil value" Link to comment
Castillo Posted September 12, 2013 Share Posted September 12, 2013 math.round is not a native function. 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 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