So I'm making a game and it needs leaderstats. The money (Cupcakes) is the in-game currency. I also want the game to give the player +10 Cupcakes every minute (60 seconds.) So if anyone has a script(s) for this, I would be glad to try it out! -Ally c:
This is what you need to do; Insert a script, and type:
local dataStore = game:GetService(“DataStoreService”):GetDataStore(“Cupcakes”) game.Players.PlayerAdded:Connect(function(plr) local folder = Instance.new(“Folder”,plr) folder.Name = “leaderstats” local cupcakes = Instance.new(“IntValue”,leaderstats) cupcakes.Value = dataStore:GetAsync(plr.UserId) while wait(60) do cupcakes.Value = cupcakes.Value + 10 dataStore:SetAsync(cupcakes.Value, plr.UserId) end end)
Sorry if it’s a bit messy, I’m doin this on my phone :0