Artes-s

Snow_ball_by_Artes

Dec 30th, 2015
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. @name Snow_ball_by_Artes
  2. @persist [O E SnowBall]:entity Just N Table:table
  3. interval(100)
  4. if(first()){
  5. noDuplications()
  6. setName("Снежок от Artes'a")
  7. E=entity()
  8. O=owner()
  9. Just = 1
  10. Base = holoCreate(0,E:toWorld(vec(0,0,0)),vec(0.001),E:toWorld(ang(0,0,0)),vec(255),"cube") holoParent(0,E)
  11. Table:pushArray(array(Base:toWorld(vec(0,0,2)),vec(0.5),Base:toWorld(ang(0,0,0)),vec(255),"sphere3"))
  12. }
  13. if(Table:count() > N) {
  14. while(holoCanCreate() & perf()) {
  15. N++
  16. local Holo = Table[N, array]
  17. holoCreate(N, Holo:vector(1), Holo:vector(2), Holo:angle(3), Holo:vector(4), Holo:string(5)):setModel(Holo:string(5))
  18. holoMaterial(N, Holo:string(6))
  19. holoAlpha(N,255)
  20. holoParent(N, Base)
  21. holoMaterial(N,"debug/debugdrawflat")
  22. }
  23. } else {
  24. if(O:weapon():type() == "weapon_crowbar") { Just = 1 O:weapon():setAlpha(0) } else { Just = 0 }
  25. if(Just){
  26. if(!SnowBall&changed(O:keyAttack1())&O:keyAttack1()){
  27. SnowBall = propSpawn("models/segment3.mdl",owner():pos() + vec(0,0,60) + owner():eye()*50,owner():eye():toAngle()+ang(0,0,0),0)
  28. SnowBall:setAlpha(0)
  29. SnowBall:propFreeze(0)
  30. holoUnparent(0)
  31. holoPos(0,SnowBall:pos())
  32. holoAng(0,SnowBall:angles()+ang(90,0,180))
  33. holoParent(0,SnowBall)
  34. SnowBall:setMass(1)
  35. SnowBall:applyForce(O:eye() * SnowBall:mass() * 2000 + O:vel()*50) #Def 2500
  36. noCollideAll(SnowBall,0)
  37. O:soundPlay(1,1,"ambient/materials/footsteps_glass1.wav")
  38. timer("remove",500)
  39. timer("holo",1200)
  40. }
  41. }
  42. if(changed(O:keyAttack2())&O:keyAttack2()){
  43. timer("remove",1)
  44. timer("holo",1)
  45. }
  46. if(clk("holo")){
  47. stoptimer("holo")
  48. holoUnparent(0)
  49. holoPos(0,O:attachmentPos("anim_attachment_rh"))
  50. holoAng(0,O:attachmentAng("anim_attachment_rh"))
  51. holoParentAttachment(0,O,"anim_attachment_rh")
  52. }
  53. if(changed(Just)&Just) {
  54. setName("Снежок от Artes'a")
  55. holoPos(0,O:attachmentPos("anim_attachment_rh"))
  56. holoAng(0,O:attachmentAng("anim_attachment_rh"))
  57. holoPos(0,holoEntity(0):toWorld(vec(0,0,0)))
  58. holoParentAttachment(0,O,"anim_attachment_rh")
  59. } elseif(changed(!Just)&!Just) {
  60. if(!first()){
  61. holoUnparent(0)
  62. holoPos(0,E:pos())
  63. holoAng(0,E:angles())
  64. holoParent(0,E)
  65. }
  66. }
  67. if(clk("remove")){
  68. SnowBall:remove(1)
  69. stoptimer("removed")
  70. }
  71. }
Add Comment
Please, Sign In to add comment