Dividing Issue in Roblox

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

You mean that u want to set upgrades.Speed.Value Divided by 1.1?

upgrades.Speed.Value = upgrades.Speed.Value / 1.1
2 Likes

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

You want to set upgrades.Speed.Value to upgrades.Speed.Value / 1.1?

if yes then

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

Change it to a NumberValue.
For any descriptions of Values check here: NumberValue | Documentation - Roblox Creator Hub

3 Likes

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

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.