game.Players.PlayerAdded:connect(function(player) stats = Instance.new("IntValue",player) stats.Name = "Leaderstats" end)
This should work:
game.Players.PlayerAdded:connect(function(player) local stats = Instance.new("IntValue",player) stats.Name = "Leaderstats" end)