using { /Fortnite.com/Devices } using { /Verse.org/Simulation } PanicTimerLogic := class(creative_device): @editable TimerDevice: timer_device = timer_device{} var IsPanic: logic = false var PanicScale: float = 1.0 # NEW: drives the blink effect below 5 s var BlinkState: logic = false OnBegin(): void = TimerDevice.Start() TimerDevice.SuccessEvent.Subscribe(OnTimerEnd) spawn { RunUpdateLoop() } spawn { RunBlinkLoop() } # second coroutine for blinking # ---- per-second state update ---- RunUpdateLoop(): void = loop: Sleep(1.0) UpdatePanicState() # ---- half-second blink toggle (only visible when BlinkState matters) ---- RunBlinkLoop(): void = loop: Sleep(0.5) set BlinkState = not BlinkState # flip true <-> false OnTimerEnd(Agent: agent): void = set IsPanic = false set PanicScale = 1.0 set BlinkState = false UpdatePanicState(): void = TimeRemaining: float = 60.0 - TimerDevice.GetCurrentTime() if (TimeRemaining <= 5.0): # CRITICAL: yellow + blink (BlinkState drives widget opacity) set IsPanic = true set PanicScale = 1.5 # BlinkState is already toggling in RunBlinkLoop else if (TimeRemaining <= 10.0): # PANIC: red, enlarged, no blink set IsPanic = true set PanicScale = 1.5 set BlinkState = true # keep fully visible else: set IsPanic = false set PanicScale = 1.0 set BlinkState = true # keep fully visible