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

Is it possible to have datastores that can save throughout the whole entire game/ other places?

Asked by 5 years ago
local cashs = game:GetService("DataStoreService"):GetDataStore('Stats', 'Cash')



function onPlayerAdded(player)
    local stats = Instance.new('Folder', player)
    stats.Name = 'leaderstats'
    local cash = Instance.new('IntValue', stats)
    cash.Name = 'Cash'
    cash.Value = cashs:GetAsync(player.UserId) or 500


    cash.Changed:Connect(function()
        cashs:SetAsync(player.UserId, cash.Value)
    end)
end

game.Players.PlayerAdded:Connect(onPlayerAdded)
1
Datastores work throughout an entire game, and any places inside of it. They cannot be accessed by places outside of the game. theCJarmy7 1293 — 5y
0
Use the HTTP service and write to some external server somewhere. fredfishy 833 — 5y

1 answer

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

Datastores work inside an entire universe (a collection of places under a game). If you want to save outside of one universe and into another, then like fredfishy commented, you would need the HTTP service and an external storage. Note that HTTP request limitations are global though while Roblox datastores are local to the server they are in.

Ad

Answer this question