Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created By NameDevv On Roblox --
- -- Subscribe To Name Devv On YouTube --
- -- Turn On Post Notifications For More Script´s --
- local DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerStats")
- function playerAdded(plr)
- local stats = Instance.new("StringValue");
- stats.Parent = plr;
- stats.Name = "leaderstats";
- local cash = Instance.new("IntValue");
- cash.Parent = stats;
- cash.Name = "Cash";
- local usr = "user_" .. plr.userId;
- DataStore:UpdateAsync(usr, function(oldValue)
- local theNewValueYouWant = 0;
- if (oldValue ~= nil) then
- theNewValueYouWant = 0;
- end
- return theNewValueYouWant;
- end)
- cash.Value = DataStore:GetAsync(usr);
- end
- game.Players.PlayerAdded:connect(playerAdded);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement