GSC reference › Built-in
SetTimer()
Built-in (engine)
Server
UI Called on: hud_timer_element
Set a timer HUD element to count down
Signature
<hud_timer_element> SetTimer(<time>)
Called on an entity: hud_timer_element SetTimer(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| time | Required | The new timer time |
Example (from Treyarch's docs)
level.reinforcement_hud SetTimer( level.counter )
Real uses in BO3's scripts
Called 18 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_util.gsc, line 273
self.lowertimer settimer(time); - scripts/zm/zm_moon_digger.gsc, line 1556
elem settimer(time_to_help_them); - scripts/mp/_util.gsc, line 149
self.lowertimer settimer(time); - scripts/mp/gametypes/ctf.gsc, line 1354
level.returnmessageelems["axis"][ownerteam] settimer(time); - scripts/mp/gametypes/hq.gsc, line 364
timerdisplay[team] settimer(level.hqspawntime);
Related built-ins
- SetTenthsTimer()Set a timer HUD element to count down in tenths of a second
- SetTenthsTimerUp()Set a timer HUD element to count up in tenths of a second
- SetTimerUp()Set a timer HUD element to count up
- SetBombTimer()Bomb timer set in the match state
- DoubleXPTimerFired()Used to decrement consumable double xp promotions
- matchRecordOvertimeRound()Call after matchRecordRoundStart to mark the round as an overtime round (only first overtimee round is actually recorded)
- SetText()Set HUD text for this element.
- SetUIModelValue()Sets a UIModel from the model being passed in.
- Destroy()Remove this Hud element altogether.
- FadeOverTime()Set a hud element to transition in color (or alpha) over time.
- CreateUIModel()Creates and returns a UIModel from a parent model.
- GetUIModel()Returns a UIModel from the parent model passed in and the name of the model to retrieve.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).