local marketplace = game:GetService("MarketplaceService")
local info = marketplace:GetDeveloperProductsAsync():GetCurrentPage()
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local donation = Instance.new("IntValue",leaderstats)
donation.Name = "Donated"
end)
This line delays the script and the function cannot connect in time, leave it like this
local marketplace = game:GetService("MarketplaceService")
local info = marketplace:GetDeveloperProductsAsync():GetCurrentPage()
function PlayerAdded(plr)
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local donation = Instance.new("IntValue",leaderstats)
donation.Name = "Donated"
end
for _, plr in pairs(game:GetService("Players":GetPlayers()) do
PlayerAdded(plr)
end
game:GetService("Players").PlayerAdded:Connect(PlayerAdded)
You could also put the PlayerAdded function first.