Glorpia Docs
Instances / ValueBase

ObjectValue

Stores a reference to another Instance.

Inheritance

ObjectValue is a ValueBase class and inherits the shared hierarchy API from Instance.

Members

NameTypeDescription
ValueInstance or nilThe value stored by this instance.
ChangedsignalFires when Value changes and passes the new value.

Example

Luau
local value = Instance.new("ObjectValue")
value.Name = "ExampleValue"
value.Value = workspace:FindFirstChild("Part")
value.Parent = workspace

value.Changed:Connect(function(newValue)
    print(newValue)
end)

Referenced instances

ObjectValue stores the referenced Instance ID. If the target is unavailable on a client, reading Value returns nil until that Instance is present.

Related