I want to add 2 every second to a value called "MoneyValue".
lvl1money = 2 -- the amount of money you get per second
game.Players.PlayerAdded:connect(function(player)
for i,v in pairs(game.Workspace.Mines:GetChildren()) do
local money = player.leaderstats.Money.Value
v.Name = math.random(1,100) --random names for all the goldmines
wait(1)
v.Collect.MoneyValue.Value = v.Collect.MoneyValue.Value + lvl1money -- adds money overtime to value in mine (collect)
print(v.Collect.MoneyValue.Value)
end
end)
This is a script in ServerScriptService.
