Hi, I made it so every 60 seconds or 1 minute, you get 50 cash, but It doesn't save, how do I use datastorage? pls help, thanks.
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 100
cash.Parent = stats
stats.Parent = newPlayer
while true do
cash.Value = cash.Value + 50
wait(60)
end
end
game.Players.ChildAdded:connect(onPlayerEntered)

4 comments
Enjoy!
P.S Just leave this in workspace.
This will not work, I don't even see the DataStore service
You're using deprecated terms in this script. 'SaveNumber' is associated with Data Persistence, which has long been deprecated. DataStore is the new way to save data.