I have a NumberValue, it's like 10. How to make another value, wich is making the 10 to 0.10 with can be used on Properties values. i tried this:
Speed = 10
Speed2 = "0." ..Speed
Sound.Volume = Speed2
But it isn't working.
I have a NumberValue, it's like 10. How to make another value, wich is making the 10 to 0.10 with can be used on Properties values. i tried this:
Speed = 10
Speed2 = "0." ..Speed
Sound.Volume = Speed2
But it isn't working.
Divide
Surely you know how to divide. To make a number scaling from 0 to 100 into a decimal, which I assume is what you're doing given the context, just divide it by 100.
Speed = 10
Speed2 = Speed/100
Sound.Volume = Speed2
You're attempting to concatenate Speed with a string, which will then convert the value of Speed to a string inside of the variable, making Speed2 equal to the PHRASE "0.10", but not the value 0.10. The following code should fix your problem.
Speed = "10"
Speed2 = "0." .. Speed
Speed3 = tonumber(Speed2)
Sound.Volume = Speed3
0.1 is not an integer
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
No, it dosn't work
You can press the Accept Answer button. Do yourself a favour.