hey there i made a dev product so when they buy more cash it works but how would i save that i have a data store script but how would i save if they bought 300 when they leave they still have the 300 they bought plus the money they had before i have a data store script to save the cash but it dosent save the bought cash :)
COMMUNITY QUESTION
hello can i get help with my data store script please?
1 answer
local DSS = game:GetService("DataStoreService"):GetDataStore("MoneySave")
game:GetService("Players").PlayerAdded:Connect(function(player)
local key = "player_" .. player.UserId
local money = player:WaitForChild("Money") --if this is a value you have
money.Value = DSS:GetAsync(key)
end)
game:GetService("Players").PlayerRemoving:Connect(function(player)
local key = "player_" .. player.UserId
local money = player:WaitForChild("Money") --if this is a value you have
DSS:SetAsync(key,money.Value)
end)
2 comments
0
thank you
0
accept the answer please
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Your kinda talking about a admin tools thing, but sadly i don't understand, can i see ur script?
Use the Gamepass Service and simply store it as a Gamepass. Then use data storing.
saving your cash?? i dont undrstand your questions
Please show your scripts or code, this is not an request site.