Advertisement
Guest User

cl_init.lua

a guest
Dec 6th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.01 KB | None | 0 0
  1. AddCSLuaFile("shared.lua")
  2. include "shared.lua"
  3.  
  4. function ENT:Draw()
  5.     self:DrawModel()
  6. end
  7.  
  8. surface.CreateFont("MiraiDefuseFont", {
  9.     font = "Times New Roman",
  10.     size=20,
  11.     antialias=true,
  12.     italic=false,
  13.     shadow=true,
  14.     additive = false,
  15.     outline = false,
  16.     underline = false,
  17.     weight = 500,
  18.     bold=false,
  19.     blursize = 0,
  20.     scanlines = 0 })
  21.  
  22. surface.CreateFont("MiraiBombFont", {
  23.     font = "Times New Roman",
  24.     size=40,
  25.     antialias=true,
  26.     italic=false,
  27.     shadow=true,
  28.     additive = false,
  29.     outline = false,
  30.     underline = false,
  31.     weight = 500,
  32.     bold=true,
  33.     blursize = 0,
  34.     scanlines = 0 })
  35.  
  36.  
  37. net.Receive("beep", function()
  38.  
  39.     surface.PlaySound("MiraiExplosives/beep.mp3")
  40.  
  41. end)
  42.  
  43.  
  44.  
  45. function Problem1()
  46.  
  47.     local a1 = math.random(700,2000)
  48.     local a2 = math.random(700,2000)
  49.     local ans = a1+a2
  50.  
  51.     local frame1 = vgui.Create("DFrame")
  52.         frame1:SetPos(280,400)
  53.         frame1:SetSize(800,200)
  54.         frame1:SetVisible(true)
  55.         frame1:SetTitle("Bomb defusing screen.  --  Addon created by Lord Mirai (未来)")
  56.         frame1:MakePopup()
  57.  
  58.     local TitL1 = vgui.Create("DLabel",frame1)
  59.         TitL1:SetText("Defuse Bomb")
  60.         TitL1:SetPos(280,20)
  61.         TitL1:SetSize(600,80)
  62.         TitL1:SetFont("MiraiBombFont")
  63.         TitL1:SetColor(Color(0,0,0,255))
  64.  
  65.     local QL1 = vgui.Create("DLabel",frame1)
  66.         QL1:SetText("What is  "..tonumber(a1).." + "..tonumber(a2).." ?" )
  67.         QL1:SetPos(250,80)
  68.         QL1:SetSize(400,50)
  69.         QL1:SetFont("MiraiDefuseFont")
  70.         QL1:SetColor(Color(70,10,110,245))
  71.  
  72.     local In1 = vgui.Create("DTextEntry",frame1)
  73.         In1:SetSize(300,40)
  74.         In1:SetPos(250,130)
  75.         In1.OnEnter = function(self)
  76.  
  77.             local subAnswer = tonumber(self:GetValue())
  78.             print("You said "..subAnswer)
  79.             frame:SetVisible(false)
  80.            
  81.             if subAnswer == ans then
  82.                
  83.                 Problem2()
  84.  
  85.             else
  86.                 print("You cut the wrong wire!")
  87.                 frame:SetVisible(false)
  88.                 net.Start("BombDefuseFail")
  89.                 net.SendToServer()
  90.  
  91.             end
  92.         end
  93. end
  94.  
  95.  
  96.  
  97. function Problem2()
  98.  
  99.     local b1 = math.random(1700,5000)
  100.     local b2 = math.random(1700,5000)
  101.     local ans2 = b1+b2
  102.     print(ans2)
  103.  
  104.    
  105.     local frame2 = vgui.Create("DFrame")
  106.         frame2:SetPos(280,400)
  107.         frame2:SetSize(800,200)
  108.         frame2:SetVisible(true)
  109.         frame2:SetTitle("Bomb defusing screen.  --  Addon created by Lord Mirai (未来)")
  110.         frame2:MakePopup()
  111.  
  112.     local TitL2 = vgui.Create("DLabel",frame2)
  113.         TitL2:SetText("Defuse Bomb")
  114.         TitL2:SetPos(280,20)
  115.         TitL2:SetSize(600,80)
  116.         TitL2:SetFont("MiraiBombFont")
  117.         TitL2:SetColor(Color(0,0,0,255))
  118.  
  119.     local QL2 = vgui.Create("DLabel",frame2)
  120.         QL2:SetText("What is  "..tonumber(b1).." + "..tonumber(b2).." ?" )
  121.         QL2:SetPos(250,80)
  122.         QL2:SetSize(400,50)
  123.         QL2:SetFont("MiraiDefuseFont")
  124.         QL2:SetColor(Color(70,10,110,245))
  125.  
  126.     local In2 = vgui.Create("DTextEntry",frame2)
  127.         In2:SetSize(300,40)
  128.         In2:SetPos(250,130)
  129.         In2.OnEnter = function(self)
  130.  
  131.             In2:SetValue("")
  132.             local subAnswer = tonumber(self:GetValue())
  133.             print("You said "..subAnswer)
  134.             frame2:SetVisible(false)
  135.            
  136.             if subAnswer == ans2 then
  137.                
  138.                 print("You successfully defused a bomb!")
  139.                 net.Start("BombDefuseSuccess")
  140.                 net.SendToServer()
  141.  
  142.             else
  143.                 print("You cut the wrong wire!")
  144.                 net.Start("BombDefuseFail")
  145.                 net.SendToServer()
  146.  
  147.             end
  148.         end
  149.  
  150.  
  151.  
  152. end
  153.  
  154. net.Receive("Fuse", function()
  155.  
  156.  
  157.     local FuseGUI = vgui.Create("DFrame",frame)
  158.         FuseGUI:SetPos(280,400)
  159.         FuseGUI:SetSize(200,150)
  160.         FuseGUI:SetVisible(true)
  161.         FuseGUI:SetTitle("Mirai's bomb. Enter timer to kill ppl >;3")
  162.         FuseGUI:MakePopup()
  163.  
  164.     local TimeL = vgui.Create("DLabel",frame)
  165.         TimeL:SetText("Set timer in seconds (must be higher than 30):")
  166.         TimeL:SetPos(280,30)
  167.         TimeL:SetSize(600,80)
  168.         TimeL:SetFont("MiraiBombFont")
  169.         TimeL:SetColor(Color(220,10,10,255))
  170.  
  171.     local TimeIn = vgui.Create("DTextEntry",FuseGUI)
  172.         TimeIn:SetPos(280,90)
  173.         TimeIn:SetSize(300,80)
  174.         TimeIn.OnEnter = function(self)
  175.  
  176.             BombFuseTimer = tonumber(TimeIn:GetValue())
  177.             FuseGUI:SetVisible(false)
  178.             printedTime = BombFuseTimer
  179.             isBombFused = true
  180.  
  181.             net.Start("BombStart")
  182.             net.SendToServer()
  183.  
  184.         end
  185.  
  186.  
  187. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement