Detect when a player is in or not in a part

use a custom module for it.

you can simply reference when a player has entered/exited a zone with:

zone.playerEntered:Connect(function(player)
    print(player.Name.." entered the zone!")
end)

zone.playerExited:Connect(function(player)
    print(player.Name.." entered the zone!")
end)