Advertisement
shaieve

Untitled

Aug 14th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. hook.Add('CalcView', 'CC.CalcRagdollEyes', CalcRagdollEyes);
  2.  
  3. local soundHeart
  4. hook.Add("Tick", "TickDeathHeartBeat", function()
  5. local ply = LocalPlayer()
  6. if not IsValid(ply) then return end
  7.  
  8. if not soundHeart then
  9. soundHeart = CreateSound(game.GetWorld(), "cc/heartbeat.wav")
  10. soundHeart:SetSoundLevel(0)
  11. soundHeart:Stop()
  12. end
  13. if !ply:Alive() or ply:PassedOut() then
  14. if not soundHeart:IsPlaying() then
  15. soundHeart:Play()
  16. end
  17.  
  18. else
  19. if soundHeart:IsPlaying() then
  20. soundHeart:Stop()
  21. end
  22. end
  23.  
  24. end)
  25.  
  26. local spawnDelay = 120
  27. hook.Add( "HUDPaint", "PlayerDeathTimer", function()
  28.  
  29. local ply = LocalPlayer()
  30. if ply:Alive() then
  31. if ply.SpawnDelay then
  32. ply.SpawnDelay = false
  33. end
  34. else
  35. if !ply.SpawnDelay then
  36. ply.SpawnDelay = CurTime() + spawnDelay
  37. else
  38. draw.DrawBackgroundBlur(2)
  39.  
  40.  
  41. local scrW, scrH = ScrW(), ScrH()
  42. local w, h = scrW * 0.35, 28
  43. local x, y = (scrW * 0.5) - (w * 0.5), (scrH * 0.725) - (h * 0.5)
  44. local boxX, boxY = scrW / 2, scrH * 0.1
  45.  
  46. Text1 = "YOU ARE"
  47. Text2 = "DEAD"
  48. Text3 = "You may now respawn!"
  49. Text4 = "Time Remaining"
  50.  
  51. draw.SimpleText(Text1, "SCC_PuristaS", scrW / 2, boxY - 6, Color(0, 0, 0, 200), TEXT_ALIGN_CENTER)
  52. draw.SimpleText(Text1, "SCC_PuristaS", scrW / 2, boxY - 10, color_white, TEXT_ALIGN_CENTER)
  53.  
  54. draw.SimpleText(Text2, "SCC_PuristaA", scrW / 2, boxY + 18, Color(0, 0, 0, 200), TEXT_ALIGN_CENTER)
  55. draw.SimpleText(Text2, "SCC_PuristaA", scrW / 2, boxY + 14, Color (255, 0, 0, 255), TEXT_ALIGN_CENTER)
  56.  
  57. local remainingTime = string.FormattedTime(math.max(ply.SpawnDelay-CurTime(), 0), "%02i:%02i:%02i")
  58. local remainingTimeNum = ply.SpawnDelay-CurTime();
  59.  
  60. if (remainingTimeNum <= 0) then
  61. draw.SimpleText(Text3, "SCC_PuristaS", scrW / 2, boxY + 244, color_white, TEXT_ALIGN_CENTER);
  62. draw.SimpleText(Text3, "SCC_PuristaS", scrW / 2, boxY + 244, color_white, TEXT_ALIGN_CENTER);
  63. else
  64. draw.SimpleText(Text4, "SCC_PuristaS", scrW / 2, boxY + 244, color_white, TEXT_ALIGN_CENTER);
  65. draw.SimpleText(Text4, "SCC_PuristaS", scrW / 2, boxY + 244, color_white, TEXT_ALIGN_CENTER);
  66. draw.SimpleText(remainingTime, "SCC_PuristaS", scrW / 2, boxY + 284, color_white, TEXT_ALIGN_CENTER);
  67. draw.SimpleText(remainingTime, "SCC_PuristaS", scrW / 2, boxY + 284, color_white, TEXT_ALIGN_CENTER);
  68. end
  69. end
  70. end
  71. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement