A Detective is an investigative role that determines whether a player has killed another player, either on the night it is used or on a previous night.
The differences from Gunsmith and Rolecop, which are somewhat related roles, are mostly in connection with how it interacts with groupscum; a member of a groupscum may have the ability to kill, but prefer to allow one of their allies to kill instead. The role is also rather related to the Follower, who can also detect a kill, but only on the night that the Follower is following; a Detective can see kills on previous nights too, but cannot see actions other than kills.
The opposite of this role, detecting players who have unused kills, is a Psychologist.
In a Normal Game, a Detective may choose to investigate each night. Only three results can be obtained from this investigation: Negative, Positive, or No Result. This investigation resolves after any killing abilities in the Night phase.
A negative result is returned from players that have never attempted to kill another player (including players who cannot kill, and players who can kill but chose not to).
A positive result is returned from players that have actively killed another player, or attempted to kill another player but failed. This would include a Vigilante or a mafia member, but would not include players who could cause a player to die indirectly as a result of their action, such as a Babysitter or a Weak role.
The Detective role could plausibly be expanded to also detect players who had performed kills unintentionally (e.g. via triggering a Weak modifier), but this would be somewhat bastard. The Paranoid Gun Owner falls into a grey area; they do not have an active role, thus would not trigger the standard version of the Detective, but as killing is the role's purpose it would not be unreasonable for a nonstandard Detective to get a positive if the Paranoid Gun Owner had killed someone.
Use & Power
A Detective is an investigative role that gets more powerful the fewer scum that remain; it thus has similar balance properties to a Tracker, being about as strong if the same player performs that Mafia's kill every night, but stronger if the Mafia spread out their kills among different users. As such, care should be taken when using the Detective alongside other roles with similar balance properties (Tracker, Jailkeeper, Roleblocker); this can cause too much positive feedback in a setup.
In general, you won't go wrong playing Detective identically to Tracker; both roles are looking to investigate the player most likely to be performing the Mafia's factional kill. One difference is that in larger games, especially with multiple kills involved, you may have more trouble than a Tracker would in determining what the reason for the kill was (as you don't know who the target is); it may be a good idea, upon receiving a positive result, to ask your target to fullclaim before explaining the nature of your evidence.
Sample Role PM
Welcome, [Player]! You are a Town Detective.
- Investigate: you may investigate a player each night and discern whether that player has killed another player. You will receive a Negative result on those that have not succeeded in killing, or a Positive result on those that have made a kill with a (personal or factional) active ability. You will receive "no result" if your action is blocked.
- You win if all threats to the town are eliminated and at least one town-aligned player is alive.