Instances / ValueBase
ObjectValue
Stores a reference to another Instance.
Inheritance
ObjectValue is a ValueBase class and inherits the shared hierarchy API from Instance.
Members
| Name | Type | Description |
|---|---|---|
Value | Instance or nil | The value stored by this instance. |
Changed | signal | Fires 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.