Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does a DataStore update on all servers?

I have a DataStore with banned players script which sucessfully works. But I have a question.

Let's say I have a moderator taking in reports in a Public Server and bans a player which is playing in another server adding him into a table which is saved into the DataStore which holds bans.

Will that DataStore also update on other public servers? And on private servers? Does :OnUpdate() detect that the DataStore has been updated on the other server?

If it doesn't, how can I send a signal through every server to verify if the player is in it and kick him?

1 answer

✓ Accepted answer

yes, datastores does update globally, this is a basic script to check for an update

local datastore_service= game:GetService("DataStoreService")
local your_datastore = datastore_service:GetDataStore("Datastore")

your_datastore.OnUpdate("yourkeyhere", function()
	print("update")
end)

hope that script helps you!

edit: @vulkarin made a simple key ( ?° ?? ?°)

2 comments

0

Thanks! That gives me confidence on how simple it is!

0
  1. your_datastore.OnUpdate:Connect(function() 2. OnUpdate requires a key, it doesn't just fire when any random key is updated

This discussion is preserved as it was. New answers, comments, and votes are closed.