IntValue

Hold a count in the tree.

Value is a number, 0 by default, and takes only a number. Each change fires Changed with the new value.

Made with Instance.new("IntValue") or Clone().

Example

Count upShotScript
-- An IntValue holds a whole number. Settings.Count is one, saved in the project as 3.
local count = root.Settings.Count
count.Changed:Connect(function(value : number)
	print("Count is now " .. value)
end)
print("Count starts at " .. count.Value)
count.Value += 1
print("a new IntValue: " .. Instance.new("IntValue").Value)
What it printedOutput
Count starts at 3
Count is now 4
a new IntValue: 0

Properties

NameTypeDefaultDescription
Valuenumber0The number it holds; each change fires Changed with the new value.
From ShotInstance 33