I am making a leaderboard for the amount of cookies you have under the string of game.Players.LocalPlayer.PlayerGui.clicker.cookies.cookienum.Value
function Entered(player)
wait()
if player:findFirstChild("leaderstats") ~= nil then
player.leaderstats:remove()
end
stats = Instance.new("IntValue")
stats.Parent = player
stats.Name = "leaderstats"
cookies = Instance.new("IntValue")
cookies.Parent = stats
cookies.Name = "Cookies"
cookies.Value = game.Players.LocalPlayer.PlayerGui.clicker.cookies.cookienum.Value
end
game.Players.PlayerAdded:connect(Entered)
c = game.Players:GetChildren()
for i=1, #c do
Entered(c[i])
end
why isnt it taking that value and putting it on the leaderboard |