Hello, I’m making a system where you can purchase upgrades. One of them being speed in seconds.
Im dividing a value by 1.1
upgrades.Speed.Value / 1.1
This doesn’t give me accurate results, and whenever I try divide 3 / 1.1
or 5 / 1.1
it just stays as 3, or 5. It also doesn’t give me the decimals to the answer.
Am I doing something wrong? Any help is amazing.
3 Likes
Correct me if your trying to do something else, but wouldn’t multiplying work instead?
1 Like
MrKlocek2
(MrKlocek)
August 16, 2023, 6:27pm
#3
You mean that u want to set upgrades.Speed.Value Divided by 1.1?
upgrades.Speed.Value = upgrades.Speed.Value / 1.1
2 Likes
SyntaxChase:
upgrades.Speed.Value
Make sure you’re referencing the correct “Value”
1 Like
Yes I want to divide it by 1.1
1 Like
It is the correct value, I have checked several times.
1 Like
MrKlocek2
(MrKlocek)
August 16, 2023, 7:23pm
#7
You want to set upgrades.Speed.Value to upgrades.Speed.Value / 1.1?
if yes then
Scottifly
(Scottifly)
August 16, 2023, 7:23pm
#8
Is Speed an IntValue?
If it is then it will only be an Integer, or whole number without decimals.
And if you want to increase the speed as an upgrade why are you dividing it by 1.1? That decreases the value.
2 Likes
Yes it is, so how would I work around this?
1 Like
Scottifly
(Scottifly)
August 16, 2023, 7:27pm
#10
Change it to a NumberValue.
For any descriptions of Values check here: NumberValue | Documentation - Roblox Creator Hub
3 Likes
Scottifly
(Scottifly)
August 16, 2023, 7:31pm
#11
And as for my other comment:
3 / 1.1 = 2.7272
3 * 1.1 = 3.3
5 / 1.1 = 5.4545
5 * 1.1 = 5.5
1 Like
Thankyou for the help, but I do understand simple math.
1 Like
system
(system)
Closed
August 30, 2023, 7:40pm
#13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.