spectator mode

i need to detect if a player is spectating or not spectating another player, and if possible execute functions as the spectators of a player (like if it was execute on passenger)
Continue to help post