I found what a think is a glitch, when I subtract from a number and try to get to it returns a very odd number. my script:
local TransCount = 1
while true do
NewScythe.Handle.Transparency = TransCount
NewScythe.Handle.Union.Transparency = TransCount
TransCount = TransCount - 0.1
wait()
print(TransCount)
if TransCount == 0 then
break
end
end
what it returns
I do not have any clue as to why it does this, anyone know?
local TransCount = 1
while true do
NewScythe.Handle.Transparency = TransCount
NewScythe.Handle.Union.Transparency = TransCount
TransCount = TransCount - 0.1
wait()
print(TransCount)
if TransCount <= 0 then
break
end
end
Just to explain it, the weird number is actually a number super close to 0. This issue is something very common when dealing with floats/doubles (number with a decimal in it.) Its called a floating point error.
You can check if the number is close to 0, or use normal integer (whole numbers) instead and divide it by 10 before you use it.