Guest User

Untitled

a guest
Aug 13th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. function LoseControl:OnUpdate()
  2.     local remain = self.tEnd - GetTime()
  3.     if remain > 0 then
  4.         if remain <= 60 then
  5.             self.timer:SetTextColor(1,1,0)
  6.             self.timer:SetFormattedText("%.01f",remain)
  7.         elseif remain <= 3600 then
  8.             self.timer:SetText(ceil(remain/60).."m")
  9.             self.timer:SetTextColor(1,1,1)
  10.         else
  11.             self.timer:SetText(ceil(remain/3600).."h")
  12.             self.timer:SetTextColor(0.6,0.6,0.6)
  13.         end
  14.     else
  15.         self:Hide()
  16.     end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment