ttt_credit_adjust
ttt_credit_adjust
is a point entity available in Garry's Mod. It controls map logic to give or take credits away from a Detective or Traitor player. When activated, it tries to remove (or give) the specified number of credits from the !activator.
A practical example of this entity is to have a Traitor room door that will only open if the activator spends 1 credit. This would be done by having a ttt_traitor_button with logic as follows.
Keyvalues
- Name
(targetname)
<string> - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Credits
([todo internal name (i)])
<integer> - The amount of credits to take. This can be set to a negative value to give the !activator credits.
Inputs
TakeCredits
- Attempts to take the number of credits specified in this entity from the !activator. If the player does not have sufficient credits, the OnFail output is fired. Otherwise, OnSuccess is fired. Obviously when giving credits it never fails.
Outputs
OnSuccess
- Fired in response to TakeCredits input if the activator player has successfully received or paid the credits.
OnFail
- Fired in response to TakeCredits input if the activator player did not have sufficient credits.