Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. @name Material Changer
  2. @inputs
  3. @outputs
  4. @persist Used1
  5. @persist Used2
  6. @persist Materials:array
  7. @model models/props_combine/breenglobe.mdl
  8.  
  9. runOnKeys(owner(),1)
  10.  
  11. if (first()) {
  12. }
  13.  
  14. if (owner():weapon():type() == "weapon_crowbar") {
  15.  
  16. if (keyClk() & owner():keyAttack1() & !Used1) {
  17. Used1 = 1
  18.  
  19. # change material
  20. Prop = owner():aimEntity()
  21. if (Materials:count() != 0) {
  22.  
  23. # Prop:setMaterial(Materials:string(1))
  24. foreach(K,V:string=Materials) {
  25. Prop:setSubMaterial(K,V)
  26. }
  27.  
  28.  
  29. }
  30. } elseif (keyClk() & !owner():keyAttack1()) {
  31. Used1 = 0
  32. }
  33.  
  34. if (keyClk() & owner():keyAttack2() & !Used2) {
  35. Used2 = 1
  36.  
  37. # pick up material
  38. Prop = owner():aimEntity()
  39.  
  40. if (Prop) {
  41. Materials = Prop ? Prop:getMaterials() : Materials
  42. print("Picked up:",Prop:type())
  43. }
  44.  
  45. } elseif (keyClk() & !owner():keyAttack2()) {
  46. Used2 = 0
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement