Cash entity
Entity defined in core/entities/entities/cw_cash
Shared definition of the cw_cash entity: a non-spawnable anim entity named Cash with a networked Amount
integer.
Summary
Methods
CashEntityDraw hook returns false.model_cash option and sets up debris physics, simple use and 25 health.Amount integer holding the cash amount.Methods
Draws the cash model unless the CashEntityDraw hook returns false.
Plays a glass impact effect and a soft impact sound at the entity's position.
ENT:HUDPaintTargetID(x, y, alpha)
client gamemodes/catwork/gamemode/core/entities/entities/cw_cash/cl_init.lua:7Draws the cash name and the formatted amount when the cash is looked at.
Parameters
- x
- y
- alpha
Sets the cash model from the model_cash option and sets up debris physics, simple use and 25 health.
ENT:OnTakeDamage(damageInfo)
server gamemodes/catwork/gamemode/core/entities/entities/cw_cash/init.lua:64Subtracts the damage from the cash entity's health and destroys it at zero health.
Parameters
- damageInfo
Sets the amount of cash the entity holds and networks it to clients.
Parameters
- amount Number The cash amount
ENT:SetupDataTables()
shared gamemodes/catwork/gamemode/core/entities/entities/cw_cash/shared.lua:14Sets up the networked Amount integer holding the cash amount.
Removes the cash once a second check finds it outside the world.
ENT:UpdateTransmitState()
server gamemodes/catwork/gamemode/core/entities/entities/cw_cash/init.lua:41Always transmits the cash entity to every client.