For example if a int value is -100 and it touched a part it should turn into positive +100 is there any inverse value in this.?
COMMUNITY QUESTION
is there a inverse function or anything to a int value if not how to make inverse?
1 answer
No but you can implement your own function.
local function IV(v)
if type(v) == "number" then
return v*-1
end
end
local num = -2
local num = IV(num)
print(num) -- It pritns 2
1 comment
0
Please use proper indentation in your answers.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
yea, multiply the number by -1
No inverse function?
You can easily make your own function using theking's idea
There is a simple way to do this. Use the math.abs function. http://lua-users.org/wiki/MathLibraryTutorial
If you're using an IntValue, the code would look something like this: iValue.Value = math.abs(iValue.Value). If however, you want the opposite of whether the number is positive or negative, just multiply by -1 as theking said.