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

What are IntValues?

Asked by
Mystdar 352 Moderation Voter
10 years ago

What are IntValues and how would I use them?

2 answers

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

IntValues, short for Integer Values, are instances which store integers.

Basically, they're a "thing" which only purpose is to store a number. That number cannot be a fraction or decimal, it must be an integer, or whole number. So you could set it to 1 or 2, but not 1.5.

Since all they do is store a number, you have to get creative. One advantage is that they're an actual instance, so you can pass data between scripts.

0
They also are implemented as 2 byte integers! So they have a relatively small minimum and maximum value (around +-32,000) BlueTaslem 18071 — 10y
Ad
Log in to vote
1
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
10 years ago

They are Roblox instances with a Value property that can hold an integer. You can use them by creating one (via script or insert object) and change the value (via script or properties toolbar).

To create and edit one with a script:

local intValue = Instance.new("IntValue");
intValue.Value = 10; -- Set the value property to 10
intValue.Parent = workspace; -- Put it in Workspace
0
#Teamwork :D Perci1 4988 — 10y
0
I don't know how you managed to ninja me by 3 minutes xD jakedies 315 — 10y
0
When I pressed the post button your post was already here... The heck? Perci1 4988 — 10y
0
O_o It says I posted 12 minutes ago and you posted 8 minutes ago. But a bit ago it said you posted 4 minutes ago when I posted 1 minute ago. jakedies 315 — 10y

Answer this question