Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's the difference between a StringValue and an IntValue?

Asked by
Zero_Tsou 175
5 years ago

What we use string Value for and Int Value And what's the difference between the events i can do with them?

1 answer

Log in to vote
2
Answered by 5 years ago
Edited 5 years ago

StringValues

StringValue class has a Value property which holds a string. A string is just some text.

lua local stringVal = Instance.new("StringValue"); stringVal.Name = "randomText"; stringVal.Value = "any text can be here"; stringVal.Parent = game:GetService("Workspace");

IntValues

IntValue class has a Value property aswell, but it holds 32 bit signed integers. Signed means it can represent negatives as well. 32 bits means that is how many bits are used to represent the number. There are 8 bits in a byte. It cannot represent fractions. If you need to represent fractions, use NumberValues. NumberValues store 64-bit doubles, so they can represent bigger numbers.

lua local numberVal = Instance.new("NumberValue"); numberVal.Name = "randomNumVal"; numberVal.Value = 23142254; numberVal.Parent = game:GetService("Workspace");

0
Yep thats correct! voidofdeathfire 148 — 5y
0
Nice SoftlockedUnderZero 668 — 5y
0
You put stringVal instead of numberVal in the second code. MRbraveDragon 374 — 5y
Ad

Answer this question