You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want numbers to be a opposite, so basically if I want 1 to be opposite it would turn into 0, 0.9 would turn into 0.1, and 0.85 would turn into 0.15.
What is the issue? Include screenshots / videos if possible!
I don’t know how to do this without making a system that would take up a lot of lines of code.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes, I have looked for solutions, but all I can find is negative numbers such as 1: -1, 0.1 = -0.1 and so on.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I have tried this, but it’s not as effective.
function convert(num)
if num == 1 then
return 0
elseif num == .9 then
return 0.1
elseif num == .8 then
return 0.2
elseif num == .7 then
return 0.3
elseif num == .6 then
return 0.4
elseif num == .5 then
return 0.5
elseif num == .4 then
return 0.6
elseif num == .3 then
return 0.7
elseif num == .2 then
return 0.8
elseif num == .1 then
return 0.9
elseif num == 0 then
return 1
end
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.