I'm trying to make a tycoon game and I'm trying to change the money value inside the leaderstat folder. But I get errors saying "attempt nil with leaderstat" and I don't know why. Help appreciated.
More info, this is a normal script.
Dropper = workspace.Dropper script.Parent.ClickDetector.MouseClick:Connect(function() local Players = game:GetService("Players") if Players.LocalPlayer.leaderstats.Money.Value >= 500 then Players.LocalPlayer.leaderstats.Money.Value = Players.LocalPlayer.leaderstats.Money.Value - 500 else return end for _, v in ipairs(Dropper:GetChildren()) do if v:IsA("Part") then v.Transparency = 0 v.CanCollide = true end end script.parent:Destroy() end)