Skip to Content

Values

Typed single-value objects used to expose configuration to scripts.

ClassHolds
StringValuestring, up to 1000 characters
IntValueInteger
NumberValueFloating-point number
BoolValueboolean
Vector3ValueVector3

Numeric values are clamped to ±1,000,000,000. In Studio, insert a value by right-clicking a part, model, script or Storage and choosing New IntValue or another type. See Settings with values.

local damage = script.Damage.Value
local health = script.Parent.Health.Value

Server only

Value objects are not replicated to clients. To expose a value to clients, mirror it into State.

Properties

Value

value.Value: string | number | boolean | Vector3

The stored value. Assigning a value of the wrong type raises an error.

script.Score.Value = script.Score.Value + 1

Name

value.Name: string

Object name. value.ClassName returns the class, for example "IntValue".

Parent

value.Parent: Script | Part | Model | Value | World

The containing object. Assign to reparent the value, including under a script.

Methods

Destroy

value:Destroy()

Removes the value and its child values.

FindFirstChild

value:FindFirstChild(name: string): Value?

Returns the child value with the given name, or nil.

GetChildren

value:GetChildren(): { Value }

Returns the child values.

Events

Changed

value.Changed(newValue: any)

Fires when Value changes, with the new value.

script.Score.Changed:Connect(function(newValue)
	print("Score is now", newValue)
end)

Toolbox configuration

Toolbox models expose their tunable parameters as value objects.

ModelValues
ZombieHealth, Speed, Damage
Respawning ZombieHealth, Speed, Damage, RespawnTime
SwordDamage, Reach
RPGDamage, BlastRadius, BlastForce, ReloadTime
Sprint SystemSprintSpeed, WalkSpeed
Round SystemLobbyTime, RoundTime, MinPlayers, LobbyPosition, MapPosition, MapsFolder
Speed PadSpeed, Duration, NormalSpeed
CoinAmount, RespawnTime
DoorsOpenTime

On this page