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

hello can i get help with my data store script please?

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 :)

4 comments

0

Your kinda talking about a admin tools thing, but sadly i don't understand, can i see ur script?

0

Use the Gamepass Service and simply store it as a Gamepass. Then use data storing.

0

saving your cash?? i dont undrstand your questions

0

Please show your scripts or code, this is not an request site.

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.