Hey! Currently I am teaching myself how to do data stores and increase cash scripts. Anyone know why the value of my bucks isn’t increasing?
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "leaderstats"
local Pets = Instance.new("IntValue")
Pets.Parent = leaderstats
Pets.Name = "Pets"
Pets.Value = 1
local Bucks = Instance.new("IntValue")
Bucks.Parent = leaderstats
Bucks.Name = "Bucks"
Bucks.Value = 0
while player.leadestats:FindFirstChild("Bucks") do
wait(7)
player.leadestats.Bucks.Value = player.leaderstats.Bucks.Value + 10
end
end)
Anyone know what is causing this error?