Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Does a DataStore update on all servers?

Asked by 5 years ago

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

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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 ( ?° ?? ?°)

0
Thanks! That gives me confidence on how simple it is! wilsonsilva007 373 — 5y
0
1. your_datastore.OnUpdate:Connect(function() 2. OnUpdate requires a key, it doesn't just fire when any random key is updated Vulkarin 581 — 5y
Ad

Answer this question