StringValue class stores a single string value, extending from Class.Value. It's designed for synchronizing text data across all clients in a networked environment, such as game messages, player names, or status updates. IMPORTANT: Values should be changed on the server side. The Changed event should be connected on the client side to receive updates. NOTE: You can optionally pass a player object as the third parameter to associate the value with a specific player. Alternatively, you can concatenate the player ID to the name: "ValueName" .. tostring(player.id)
Properties
Represents the synchronized string value. Changes trigger notifications across clients via the Value.Changed event.
local message = StringValue.new("WelcomeMessage", "Hello!")
message.value = "Welcome to the game!" -- Syncs to all clients
print(message.value)
Updated 13 days ago