I got this Datastore2 script from AlvinBlox Youtube Video.
local DataStore2 = require(1936396537) local defaultValue = 2000 game.Players.PlayerAdded:Connect(function(plr) local cashDataStore = DataStore2("cash",plr) local Stats = Instance.new("Folder",plr) Stats.Name = "Stats" local cash = Instance.new("IntValue",Stats) cash.Name = "Cash" local function cashUpdate(updatedValue) cash.Value = cashDataStore:Get(updatedValue) end cashUpdate(defaultValue) cashDataStore:OnUpdate(cashUpdate) end) game.Workspace:WaitForChild("Part").ClickDetector.MouseClick:Connect(function(player) local cashDataStore = DataStore2("cash",player) cashDataStore:Increment(400,defaultValue) end)
and I want to change this part that give the 5 cash every 10 seconds. How do I change it?
game.Workspace:WaitForChild("Part").ClickDetector.MouseClick:Connect(function(player) local cashDataStore = DataStore2("cash",player) cashDataStore:Increment(400,defaultValue) end)