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

DataStores Help ?

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

1 comment

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.

1 answer

✓ Accepted answer

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

1 comment

0

thanks i think this should be enough help

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