GlobalUpdates
This item only works when running on the server. Server
Used to add, lock and change global updates
Revealed through :PostGlobalUpdate()
Types
GlobalUpdateData
type
GlobalUpdateData =
{
[
any
]
:
any
}
GlobalUpdates
Id
is the most recent update index
Functions
AddGlobalUpdate
GlobalUpdates:
AddGlobalUpdate
(
globalData:
{
}
) →
Promise
<
number
>
Adds a global update to the Keep
globalUpdates:AddGlobalUpdate({
Hello = "World!",
}):andThen(function(updateId)
print("Added Global Update!")
end)
ChangeActiveUpdate
GlobalUpdates:
ChangeActiveUpdate
(
updateId:
number
,
globalData:
{
}
) →
Promise
Change an active global update's data to the new data.
Useful for stacking updates to save space for Keeps that maybe receiving lots of globals. Ex. a content creator receiving gifts
RemoveActiveUpdate
GlobalUpdates:
RemoveActiveUpdate
(
updateId:
number
) →
Promise
Removes an active global update
local updates = globalUpdates:GetActiveUpdates()
for _, update in updates do
globalUpdates:RemoveActiveUpdate(update.Id):andThen(function()
print("Removed Global Update!")
end)
end
GetActiveUpdates
Types
Returns all active global updates
local updates = globalUpdates:GetActiveUpdates()
for _, update in updates do
print("ActiveUpdate data:", update.Data)
end