as you read the title, here’s my problem :
local color = Color3.new(0,255,0)
local numMatch = string.match(v, "%d+")
local num = tonumber(numMatch)
print(num) -- printing the number found in the text
if num < 0 then
color = Color3.new(255,0,0)
print("false")
else
print("true")
end
self.sts.Text = self.sts.Text..'<mark><font color="rgb('..color.R..','..color.G..','..color.B..')">'..v..' </font></mark>\n
this is an part of my code that changes text color declared by its own value but when this table was inserted into the code which only return positive numbers:
the table:
{"+10% MoveSpeed,
"-5% Atk",
"+100% Luck"}
the printed:
10
true
5 -- wrong
true -- which lead to this
100
true
this is weird because if the number is negative then the printed should be false and also the number was converted into positive
sorry for poorly explaining, anyhelp is appreciated