Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Basic cash data script
- local dss = game:GetService("DataStoreService")
- local store = dss:GetDataStore("cash")
- game.Players.PlayerAdded:Connect(function(plr)
- local fold = Instance.new("Folder", plr)
- fold.Name = "leaderstats"
- local data = store:GetAsync(plr.UserId)
- if data == nil then
- data = 0
- end
- local int = Instance.new("NumberValue", fold)
- int.Value = data
- int.Name = "Cash"
- end)
- while wait(20) do
- for i,v in pairs(game.Players:GetChildren() do
- v.leaderstats.Cash.Value += 100
- end
- end
- game.Players.PlayerRemoving:Connect(function(plr)
- store:SetAsync(plr.UserId, plr.leaderstats.Cash.Value)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement