I'm making a Script that adds Coins to the player's leaderstats.
It's supposed to add Coins but it doesn't and doesn't work.
Script Analysis and Output didn't even say what was wrong
FE is disabled
game.Players.PlayerAdded:connect(function(player)
if player:FindFirstChild("leaderstats") then
local Coins = Instance.new["IntValue"]
Coins.name = "Coins"
Coins.Value = 0
Coins.Parent = player.leaderstats
end
end)
while wait(10) do
for _, player in ipairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 10
end
end
end

1 comment
It is obvious you didn't check the out put... It would have said "name" a nil global or something like that and u should try WaitForChild instead of find first child