StringValue

StringValue : ValueBase

Overview

An instance used to store string value. Values set on the server are automatically replicated to the client, enabling script-to-script communication without using RemoteEvent.

Properties

Value

string

You can set a string value to store.

Code Samples

local SomeValue = Instance.new("StringValue")
SomeValue.Name = "SomeValue"
SomeValue.Parent = game.Workspace

SomeValue.Value = "Hello"

Methods

Events

Changed

An event is triggered whenever the value changes.

Parameters

string value

Changed value

Code Samples

local function OnChanged(value) 
    print(SomeValue.Name, ": ", value)
end
SomeValue.Changed:Connect(OnChanged)

See also

Manage Value

Last updated