When the (global) script is in Workspace the text is (obviously) printed. However, when the (global) script is in a TextButton in a Frame in a ScreenGui in StarterGui, nothing is printed and no errors are displayed.
game.Players.ChildAdded:connect(function(player)
print('a player has been added, yay')
end)
Should the script be a LocalScript? What am I doing wrong?

2 comments
PlayerAdded and ChildAdded are exactly the same function, so it's personal preference.
In this case, since you're using the event on Players.