Advertisement
HK47

sdfasa

May 1st, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.47 KB | None | 0 0
  1. if SERVER then
  2.     local ent = {}
  3.     local govno = {}
  4.      
  5.     local vec = {
  6.         [1] = Vector(6255, 9855, -11240),
  7.         [2] = Vector(6355, 9855, -11240),
  8.         [3] = Vector(6455, 9855, -11240),
  9.            
  10.         [4] = Vector(6455, 9955, -11240),
  11.         [5] = Vector(6355, 9955, -11240),
  12.         [6] = Vector(6255, 9955, -11240),
  13.            
  14.         [7] = Vector(6255, 10055, -11240),
  15.         [8] = Vector(6355, 10055, -11240),
  16.         [9] = Vector(6455, 10055, -11240)
  17.     }
  18.      
  19.     local cols = {
  20.         [1] = Color(255, 0, 0),
  21.         [2] = Color(0, 255, 0),
  22.         [3] = Color(0, 0, 255),
  23.        
  24.         [4] = Color(255, 255, 0),
  25.         [5] = Color(255, 0, 255),
  26.         [6] = Color(0, 255, 255),
  27.        
  28.         [7] = Color(255, 255, 255),
  29.         [8] = Color(0, 0, 0),
  30.         [9] = Color(255, 150, 0),
  31.     }
  32.    
  33.     local plat = {}
  34.    
  35.     function spawnKeyPad(pos, ang)
  36.         local keypad = ents.Create("prop_physics")
  37.         keypad:SetPos(pos)
  38.         keypad:SetAngles(ang)
  39.         keypad:SetModel("models/props_junk/watermelon01.mdl")
  40.         keypad:Spawn()
  41.    
  42.         local poses = {
  43.             [1] = keypad:LocalToWorld(Vector(-5, 0, 0)),
  44.             [2] = keypad:LocalToWorld(Vector(0, 0, 0)),
  45.             [3] = keypad:LocalToWorld(Vector(5, 0, 0)),
  46.            
  47.             [4] = keypad:LocalToWorld(Vector(-5, 0, -5)),
  48.             [5] = keypad:LocalToWorld(Vector(0, 0, -5)),
  49.             [6] = keypad:LocalToWorld(Vector(5, 0, -5)),
  50.            
  51.             [7] = keypad:LocalToWorld(Vector(-5, 0, -10)),
  52.             [8] = keypad:LocalToWorld(Vector(0, 0, -10)),
  53.             [9] = keypad:LocalToWorld(Vector(5, 0, -10))
  54.         }
  55.        
  56.         local nums = {}
  57.        
  58.         for i = 1, 9 do
  59.             nums[i] = ents.Create("prop_physics")
  60.             nums[i]:SetModel("models/hunter/plates/plate.mdl")
  61.             nums[i]:SetPos(poses[i])
  62.             nums[i]:Spawn()
  63.             nums[i]:GetPhysicsObject():EnableMotion(false)
  64.         end
  65.        
  66.         local keys = {}
  67.        
  68.         local pass = { 1, 3, 3, 7 }
  69.        
  70.         hook.Add("KeyPress", "keypad_think_lol", function()
  71.             for i = 1, 9 do
  72.                 if not IsValid(nums[i]) then hook.Remove("KeyPress", "keypad_think_lol") return end
  73.            
  74.                 for k, v in pairs(player.GetAll()) do
  75.                     local tr = v:GetEyeTrace()
  76.                     local dist = v:GetPos():Distance(nums[i]:GetPos())
  77.                    
  78.                     if tr.Entity == nums[i] and dist < 100 and v:KeyPressed(IN_USE) then
  79.                         table.insert(keys, table.maxn(keys) + 1, i)
  80.                         v:ChatPrint(i)
  81.                        
  82.                         if keys[5] then
  83.                             for count = 1, table.maxn(keys) - 1 do
  84.                                 if keys[count] == pass[count] then
  85.                                     v:ChatPrint(keys[count] .. " - norm")
  86.                                 else
  87.                                     v:ChatPrint(keys[count] .. " - ne norm")
  88.                                 end
  89.                             end
  90.                            
  91.                             v:ChatPrint("lol" )
  92.                         end
  93.                     end
  94.                 end
  95.             end
  96.         end)
  97.        
  98.         keypad:Remove()
  99.     end
  100.    
  101.     spawnKeyPad(Vector(4365, 12937, -10846), Angle(0, 90, 0))
  102.    
  103.     plat[1] = ents.Create("prop_physics")
  104.     plat[1]:SetModel("models/hunter/plates/plate1x8.mdl")
  105.     plat[1]:SetMaterial("models/shiny")
  106.     plat[1]:SetPos(Vector(6750, 9955, -11270))
  107.     plat[1]:SetColor(Color(100, 0, 0))
  108.     plat[1]:SetAngles(Angle(0, 90, 0))
  109.     plat[1]:Spawn()
  110.    
  111.     plat[2] = ents.Create("prop_physics")
  112.     plat[2]:SetModel("models/hunter/plates/plate7x24.mdl")
  113.     plat[2]:SetMaterial("phoenix_storms/stripes")
  114.     plat[2]:SetPos(Vector(4930, 7671, -11040))
  115.     plat[2]:SetAngles(Angle(90, 90, 0))
  116.     plat[2]:Spawn()
  117.    
  118.     plat[3] = ents.Create("prop_physics")
  119.     plat[3]:SetModel("models/hunter/plates/plate3x7.mdl")
  120.     plat[3]:SetMaterial("phoenix_storms/stripes")
  121.     plat[3]:SetPos(Vector(5711, 7981, -10947))
  122.     plat[3]:SetAngles(Angle(90, 0, 0))
  123.     plat[3]:Spawn()
  124.    
  125.     plat[4] = ents.Create("npc_alyx")
  126.     plat[4]:SetPos(Vector(6988, 7746, -11135))
  127.     plat[4]:SetAngles(Angle(0, 90, 0))
  128.     plat[4]:Spawn()
  129.     plat[4]:SetSolid(SOLID_NONE)
  130.    
  131.     plat[5] = ents.Create("prop_physics")
  132.     plat[5]:SetModel("models/hunter/plates/plate7x32.mdl")
  133.     plat[5]:SetMaterial("phoenix_storms/stripes")
  134.     plat[5]:SetPos(Vector(3596, 8370, -11219))
  135.     plat[5]:SetAngles(Angle(90, 90, 0))
  136.     plat[5]:Spawn()
  137.    
  138.     plat[6] = ents.Create("prop_physics")
  139.     plat[6]:SetModel("models/hunter/plates/plate7x32.mdl")
  140.     plat[6]:SetMaterial("phoenix_storms/stripes")
  141.     plat[6]:SetPos(Vector(2521, 8370, -11219))
  142.     plat[6]:SetAngles(Angle(90, 90, 0))
  143.     plat[6]:Spawn()
  144.    
  145.     local coords = {}
  146.     local angs = {}
  147.    
  148.     for i = 1, table.maxn(plat) do
  149.         table.insert(coords, i, plat[i]:GetPos())
  150.         table.insert(angs, i, plat[i]:GetAngles())
  151.     end
  152.    
  153.     hook.Add("Think", "checkprops_mg", function()
  154.         if not IsValid(plat[1]) then
  155.             plat[1] = ents.Create("prop_physics")
  156.             plat[1]:SetModel("models/hunter/plates/plate1x8.mdl")
  157.             plat[1]:SetMaterial("models/shiny")
  158.             plat[1]:SetPos(Vector(6750, 9955, -11270))
  159.             plat[1]:SetColor(Color(100, 0, 0))
  160.             plat[1]:SetAngles(Angle(0, 90, 0))
  161.             plat[1]:Spawn()
  162.         end
  163.            
  164.         if not IsValid(plat[2]) then
  165.             plat[2] = ents.Create("prop_physics")
  166.             plat[2]:SetModel("models/hunter/plates/plate7x24.mdl")
  167.             plat[2]:SetMaterial("phoenix_storms/stripes")
  168.             plat[2]:SetPos(Vector(4930, 7671, -11040))
  169.             plat[2]:SetAngles(Angle(90, 90, 0))
  170.             plat[2]:Spawn()
  171.         end
  172.        
  173.         if not IsValid(plat[3]) then
  174.             plat[3] = ents.Create("prop_physics")
  175.             plat[3]:SetModel("models/hunter/plates/plate3x7.mdl")
  176.             plat[3]:SetMaterial("phoenix_storms/stripes")
  177.             plat[3]:SetPos(Vector(5711, 7981, -10947))
  178.             plat[3]:SetAngles(Angle(90, 0, 0))
  179.             plat[3]:Spawn()
  180.         end
  181.        
  182.         if not IsValid(plat[4]) then
  183.             plat[4] = ents.Create("npc_alyx")
  184.             plat[4]:SetPos(Vector(6988, 7746, -11135))
  185.             plat[4]:SetAngles(Angle(0, 90, 0))
  186.             plat[4]:Spawn()
  187.             plat[4]:SetSolid(SOLID_NONE)
  188.         end
  189.        
  190.         if not IsValid(plat[5]) then
  191.             plat[5] = ents.Create("prop_physics")
  192.             plat[5]:SetModel("models/hunter/plates/plate7x32.mdl")
  193.             plat[5]:SetMaterial("phoenix_storms/stripes")
  194.             plat[5]:SetPos(Vector(3596, 8370, -11219))
  195.             plat[5]:SetAngles(Angle(90, 90, 0))
  196.             plat[5]:Spawn()
  197.         end
  198.        
  199.         if not IsValid(plat[6]) then
  200.             plat[6] = ents.Create("prop_physics")
  201.             plat[6]:SetModel("models/hunter/plates/plate7x32.mdl")
  202.             plat[6]:SetMaterial("phoenix_storms/stripes")
  203.             plat[6]:SetPos(Vector(2521, 8370, -11219))
  204.             plat[6]:SetAngles(Angle(90, 90, 0))
  205.             plat[6]:Spawn()
  206.         end
  207.        
  208.         for i = 1, table.maxn(plat) do
  209.             if IsValid(plat[i]:GetPhysicsObject()) then plat[i]:GetPhysicsObject():EnableMotion(false) end
  210.             plat[i]:SetPos(coords[i])
  211.             plat[i]:SetNotSolid(false)
  212.             plat[i]:SetSolid(SOLID_VPHYSICS)
  213.             plat[i]:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE)
  214.             plat[i]:SetAngles(angs[i])
  215.         end
  216.     end)
  217.    
  218.     for i = 1, 9 do
  219.         ent[i] = ents.Create("prop_physics")
  220.         ent[i]:SetModel("models/hunter/blocks/cube2x2x025.mdl")
  221.         ent[i]:SetMaterial("models/shiny")
  222.         ent[i]:SetPos(vec[i])
  223.         ent[i]:SetColor(cols[i])
  224.         ent[i]:SetAngles(Angle(0, 90, 0))
  225.         ent[i]:Spawn()
  226.         govno[i] = false
  227.        
  228.         hook.Add("Think", "minigame_thent"..i, function()
  229.             if ent[i] and IsValid(ent[i]) then
  230.                 if not govno[i] then
  231.                     ent[i]:GetPhysicsObject():EnableMotion(false)
  232.                 end
  233.             else
  234.                 ent[i] = ents.Create("prop_physics")
  235.                 ent[i]:SetModel("models/hunter/blocks/cube2x2x025.mdl")
  236.                 ent[i]:SetMaterial("models/shiny")
  237.                 ent[i]:SetPos(vec[i])
  238.                 ent[i]:SetColor(cols[i])
  239.                 ent[i]:SetAngles(Angle(0, 90, 0))
  240.                 ent[i]:Spawn()
  241.             end
  242.         end)
  243.     end
  244.    
  245.     timer.Create("minigame_timer", 4, 0, function()
  246.         for p = 1, math.random(1, 5) do
  247.             local rand = math.random(1, 9)
  248.             govno[rand] = true
  249.             ent[rand]:GetPhysicsObject():EnableMotion(true)
  250.             ent[rand]:GetPhysicsObject():ApplyForceCenter(Vector(0, 0, -60))
  251.            
  252.             timer.Simple(3, function()
  253.                 ent[rand]:Remove()
  254.                 govno[rand] = false
  255.             end)
  256.         end
  257.     end)
  258. end
  259.  
  260. if CLIENT then
  261.     hook.Add("PostDrawOpaqueRenderables", "nadpisvremya", function()
  262.         cam.Start3D2D(Vector(6990, 7697, -11020), Angle(0, 180, 90), 0.4)
  263.             draw.DrawText(string.sub(os.date(), 9), "super", 0, 0, Color(0, 255, 0), TEXT_ALIGN_CENTER)
  264.         cam.End3D2D()
  265.     end)
  266. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement