I kept getting the error “attempt to index nil with ‘WaitForChild’” and other methods included FindFirstChild and Nil etc until I actually looked at what was going on and I saw this.
Not really sure what the issue is, here’s the script.
---- leaderboard stats ----
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player) -- Parented to the player
leaderstats.Name = "leaderstats"
local hiddenstats = Instance.new("Folder", player)
hiddenstats.Name = "hiddenstats"
local clicks = Instance.new("IntValue", leaderstats)
clicks.Name = "Clicks"
clicks.Value = 0
local rebirths = Instance.new("IntValue", hiddenstats)
rebirths.Name = "Rebirths"
rebirths.Value = 0
local prestige = Instance.new("IntValue", hiddenstats)
rebirths.Name = "Prestige"
rebirths.Value = 0
local ascend = Instance.new("IntValue", hiddenstats)
rebirths.Name = "Ascend"
rebirths.Value = 0
local transend = Instance.new("IntValue", hiddenstats)
rebirths.Name = "Transcend"
rebirths.Value = 0
end)