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

DataStores Help ?

Asked by
nich17 95
9 years ago

I am making a game and i want to give every player 100$ at the end of every round and then have the game save that amount for incase they decide to leave and come back later but data stores have become confusing to me could someone please help me out here

4
can you give us some example code to how you think it could be done? So we know you're not being lazy and asking for a code. FutureWebsiteOwner 270 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

The following should give you a good example to follow:

local DSS = game:GetService("DataStoreService")
local plrDS = DSS:GetDataStore("PlayerValues")

function saveData(plr)
    plrDS:SetAsync(plr.userId .. "_key", plr.Cash.Value)
end
0
thanks i think this should be enough help nich17 95 — 9y
Ad

Answer this question