Advertisement
Artes-s

Untitled

Jan 13th, 2017
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.47 KB | None | 0 0
  1. @name Build_Mode_for_my_friend's
  2. @persist [E O]:entity Push [Set1 Set2]:string I Count Ii Prop:table X Mode
  3.  
  4. interval(20)
  5. if(first()){
  6.    alibNoDup()
  7.    E = entity()
  8.    O = owner()
  9.    #O = findPlayerByName("NikDryga")
  10.    
  11.    Mode = 1
  12.    X = 2
  13.    
  14.    Mater_1 = "models/props_debris/concretewall019a"
  15.    Prop = table(
  16.    
  17.    table("Pol",
  18.        array("models/props_junk/wood_pallet001a.mdl",65,vec(0,0,0),ang(0,0,0)),
  19.        array("models/props_junk/TrashDumpster02b.mdl",90,vec(0,0,0),ang(0,0,0)),
  20.        array("models/hunter/blocks/cube2x2x025.mdl",94.5,vec(0,0,0),ang(0,0,0),Mater_1),
  21.        array("models/hunter/blocks/cube3x3x025.mdl",142,vec(0,0,0),ang(0,0,0),Mater_1)
  22.        ),
  23.  
  24.    table("Steni",
  25.        array("models/hunter/blocks/cube2x3x025.mdl",139.5,vec(0,0,53),ang(90,0,90),Mater_1), # Kamenaya Stena
  26.        array("models/props_c17/gravestone003a.mdl",50,vec(0,0,53),ang(0,90,0),Mater_1), # Kamenaya Stena
  27.        array("models/props_wasteland/wood_fence01a.mdl",125,vec(0,0,55),ang(0,0,0))# Derevanaya Stena
  28.        ),
  29.    
  30.    table("Barikadi",
  31.        array("models/props_phx/construct/concrete_barrier00.mdl",120,vec(0,0,0),ang(0,0,0)),
  32.        array("models/props_phx/construct/concrete_barrier01.mdl",120,vec(0,0,0),ang(0,0,0)),
  33.        array("models/props_combine/combine_barricade_med01a.mdl",62.5,vec(0,0,0),ang(0,90,0)), # Metal Small
  34.        array("models/props_combine/combine_barricade_med01b.mdl",62.5,vec(0,0,0),ang(0,90,0)) # Metal Big
  35.    )
  36.        
  37.    )
  38.    
  39.    O:giveWeapon("weapon_stunstick")
  40.    
  41.    holoCreate(900,E:toWorld(vec(0,0,0)),vec(1,2,1),E:toWorld(ang(0,0,0)),vec(255),"cube")
  42.    holoCreate(901,E:toWorld(vec(0,0,0)),vec(1,2,1),E:toWorld(ang(0,0,0)),vec(255),"cube")
  43.    holoCreate(902,E:toWorld(vec(0,0,0)),vec(1),E:toWorld(ang(0,0,0)),vec(255),"cube")
  44.    
  45.    holoModel(902,Prop[1,table][2,array][1,string])
  46.    holoAlpha(902,150)
  47.        
  48. } else {
  49.  
  50.    if( O:keyAttack2() & changed(O:keyAttack1()) & O:keyAttack1() ){4
  51.        if( O:weapon():type() == "weapon_stunstick" ) {
  52.        Push = !Push
  53.        if(Push){
  54.            holoPos(900,O:aimPos())
  55.        }
  56.        if(!Push){
  57.            holoPos(901,O:aimPos())
  58.            Set1 = "Done"
  59.            Set2 = "Done"
  60.        }
  61.        
  62.        holoAng(901,(holoEntity(900):pos()-holoEntity(901):pos()):toAngle())
  63.        holoAng(900,(holoEntity(901):pos()-holoEntity(900):pos()):toAngle())  
  64.  
  65.        Ii = 0
  66.        }
  67.    }
  68.    
  69.  
  70.    if( changed((Set1 == "Done") & (Set2 == "Done")) & (Set1 == "Done") & (Set2 == "Done") ){
  71.        Count = (holoEntity(901):pos():distance(holoEntity(900):pos()))/Prop[Mode,table][X,array][2,number]
  72.        
  73.        Count = I + Count
  74.    }
  75.  
  76.    if( (Set1 == "Done") & (Set2 == "Done") ){
  77.        
  78.        if(I>=Count){ Set1 = "" Set2 = "" }
  79.        while( holoCanCreate() & I < Count & perf(1) ){
  80.  
  81.            local Ang = (holoEntity(901):pos()-holoEntity(900):pos()):toAngle()+Prop[Mode,table][X,array][4,angle]
  82.            holoCreate(I,holoEntity(900):toWorld(vec(Prop[Mode,table][X,array][2,number]*Ii,0,0))+ Prop[Mode,table][X,array][3,vector],vec(1),Ang,vec(255),"cube")
  83.  
  84.            holoEntity(I):alibHoloSolid()
  85.            holoModel(I,Prop[Mode,table][X,array][1,string])
  86.            holoMaterial(I,Prop[Mode,table][X,array][5,string])
  87.            
  88.            I++
  89.            Ii++
  90.        }
  91.    
  92.    }
  93.    
  94.    # Buttons Function #
  95.    if(O:keyAttack2()){
  96.        local Ang = Prop[Mode,table][X,array][4,angle]
  97.        holoPos(902,O:aimPos()+Prop[Mode,table][X,array][3,vector])
  98.        holoAng(902,Ang)
  99.        holoMaterial(902,Prop[Mode,table][X,array][5,string])
  100.        holoVisible(902,players(),1)
  101.    } else {
  102.        holoVisible(902,players(),0)
  103.    }
  104.    
  105.    if( O:keyAttack2() & changed(O:keyReload())&O:keyReload() & O:aimEntity():type() == "gmod_wire_hologram" ){
  106.        O:aimEntity():remove(1)
  107.    }
  108.        
  109.    # Change Mode
  110.    if(changed(O:keyPressed("T"))&O:keyPressed("T") & Set1=="" ){
  111.        if( Prop:count() > Mode ){ Mode++ X=2 } else { Mode = 1 }
  112.        
  113.        alibChatPrint(O,Prop[Mode,table][1,string])
  114.  
  115.        holoModel(902,Prop[Mode,table][X,array][1,string])
  116.        holoAlpha(902,150)
  117.    }
  118.    
  119.    # Change Mode Model
  120.    if(changed(O:keyUse())&O:keyUse() & Set1=="" ){
  121.        if( Prop[Mode,table]:count() > X ){ X++ } else { X = 2 }
  122.        holoModel(902,Prop[Mode,table][X,array][1,string])
  123.        holoAlpha(902,150)
  124.    }
  125.    
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement