My script won't detect when a player joins the game.

Script:

game.Players.PlayerAdded:Connect(function(player)
	print("Test") -- When I joined the game, this didn't even print out, meaning the script never even got to that point
end)

SOLUTION: I put my script in server script service, then it worked