I can not believe i’m asking this, but well, i need to divide a number in my game in 2, it should be pretty easy, after all, this is a basicly code… but the number just won’t divide.
The problem that i’m having, is that this number won’t accept being a decimal number, actually, because it accepts being divided as long as the result isn’t a decimal number, but if it is, it’ll round to the closest number… so how do divide this number to a decimal number?
Btw, when i force the value to be a decimal, this error appears
Your code is looking for an Integer more specifically a 64-bit integer, which is supposed to be a whole number up to 2^63, if the number contains a decimal value (ex: 3.14159) its considered to be a Float and not accepted.
You may have to round the number (math.floor()math.ceil()math.round()) for order for it to accept it as a Integer.
For your error, you are putting in a string instead of a number.
Hello, what type of Instance is the SpeedMultiplier? If it’s a StringValue, change it to a NumberValue since the output is erroring out that you cannot use strings into arithmetics.
Or, if you want to keep it a string value, you will have to use the method tonumber() and roblox will then automatically convert the number into a string back again
pst dunno if someone told you this or not but you can make this code so much better, see you are doing:
This works, but its kinda long, soooo heres how we can shorten it!
by using the equal sign we can tell the well code editor or whatever, that we want to make changes to the original value, so we can do this:
i already knew that, but it didn’t work for me for some reason, (i was starting to learn how to code), so i used that because i knew it would work, and i was going to do that in this code, but since it wasn’t working because of the IntValue, i did it that way to see if it works, but now that it’s working, i’ll do it like that again.