..:D&G:.. Posted January 22, 2014 Posted January 22, 2014 Hello, I want to convert a number into a number with commas, but I keep getting the error string expected got nill... function transformaNumar( theNumber ) local numaruldefacut = theNumber while true do numaruldefacut , p = string.gsub(numaruldefacut , "^(-?%d+)(%d%d%d)", "%1,%2") if (p==0) then break end end return numaruldefacut end
Gallardo9944 Posted January 22, 2014 Posted January 22, 2014 Might help though. function transformaNumar( theNumber ) local numaruldefacut = theNumber while true do if not (numaruldefacut == tostring(numaruldefacut)) then -- If it's not the string right now break -- Stop it end numaruldefacut , p = string.gsub(numaruldefacut , "^(-?%d+)(%d%d%d)", "%1,%2") if (p==0) then break end end return numaruldefacut end
..:D&G:.. Posted January 22, 2014 Author Posted January 22, 2014 It worked thx So I don't make another post... I will post here function esteJucatorulAdmin( thePlayer ) if ( isElement( thePlayer ) ) then local iaStatusulStaffului = getElementData(thePlayer, "esteJucatorulAdmin") if ( iaStatusulStaffului ) then return true else return false end else return false end end else return false end The 'return false': attempt to concatenate a boolean value
Alexs Posted January 22, 2014 Posted January 22, 2014 function esteJucatorulAdmin( thePlayer ) return isElement(thePlayer) and getElementData(thePlayer, "esteJucatorulAdmin") or false end Try that.
..:D&G:.. Posted January 22, 2014 Author Posted January 22, 2014 Thx You guys are good scripters, I can't wait the day when I will be like you xDD
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