So lets talk about values.There is string ( text message ) bool ( true or false ) int ( usually a number or leaderstats but sometimes used to store numbers ) and number value i pretty much never see anyone use this type and they use int idk the difference of the 2 but what i do know is that they both store numbers but WHATS THE DIFFERENCE? WHEN DO WE USE THEM AND WHY???
IntValue
s store a 32-bit signed integers as their values. Ssigned means that it can represent negative numbers. 32-bit means that that's how many bits are used to represent the number (there are eight bits in a byte). If you add 1 to the maximum value of an IntValue
, which is 2,147,483,647, it will wrap around to the minimum value, which is -2,147,483,648. Being an integer, it does not allow us to represent fractions.
NumberValue
objects store 64-bit doubles as their values. This means that they can represent much bigger numbers than IntValue
s, and that they can be used to represent fractions.
If you need to represent a fraction or a very large number, use a NumberValue
. But if you don't, just an IntValue
is fine.