SetData||doc136341

September 20, 2022

Format

GlobalDataStore:SetData(key, value)

Describe

Set the value on the key corresponding to the global data.

parameter

Variable name Type Describe
key string key
value variant value

Code example

Set the information of a player in the global data of the "message board".

local messageBoardData = Engine.DataService:GetGlobalDataStore("MessageBoard")
messageBoardData:SetData("Player_A", "hahaha")