Need to assign the player to an upvalue. Return in a function given to a Connect method means that the value would be returned to the Connect method call and the engine doesn’t do anything with any values returned to Connect.
local added, player
added = Thing:Connect(function (foobar)
player = foobar
I mean though, unless you’re doing anything else in this function, you just check whatever gets passed to PlayerAdded and then disconnect, so why not just use wait?
local player = Players.PlayerAdded:Wait()
Functionally the same and doesn’t require you to manage a connection. When PlayerAdded fires, this will return whatever PlayerAdded fired with.