Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Snow_ball_by_Artes
- @persist [O E SnowBall]:entity Just N Table:table
- interval(100)
- if(first()){
- noDuplications()
- setName("Снежок от Artes'a")
- E=entity()
- O=owner()
- Just = 1
- Base = holoCreate(0,E:toWorld(vec(0,0,0)),vec(0.001),E:toWorld(ang(0,0,0)),vec(255),"cube") holoParent(0,E)
- Table:pushArray(array(Base:toWorld(vec(0,0,2)),vec(0.5),Base:toWorld(ang(0,0,0)),vec(255),"sphere3"))
- }
- if(Table:count() > N) {
- while(holoCanCreate() & perf()) {
- N++
- local Holo = Table[N, array]
- holoCreate(N, Holo:vector(1), Holo:vector(2), Holo:angle(3), Holo:vector(4), Holo:string(5)):setModel(Holo:string(5))
- holoMaterial(N, Holo:string(6))
- holoAlpha(N,255)
- holoParent(N, Base)
- holoMaterial(N,"debug/debugdrawflat")
- }
- } else {
- if(O:weapon():type() == "weapon_crowbar") { Just = 1 O:weapon():setAlpha(0) } else { Just = 0 }
- if(Just){
- if(!SnowBall&changed(O:keyAttack1())&O:keyAttack1()){
- SnowBall = propSpawn("models/segment3.mdl",owner():pos() + vec(0,0,60) + owner():eye()*50,owner():eye():toAngle()+ang(0,0,0),0)
- SnowBall:setAlpha(0)
- SnowBall:propFreeze(0)
- holoUnparent(0)
- holoPos(0,SnowBall:pos())
- holoAng(0,SnowBall:angles()+ang(90,0,180))
- holoParent(0,SnowBall)
- SnowBall:setMass(1)
- SnowBall:applyForce(O:eye() * SnowBall:mass() * 2000 + O:vel()*50) #Def 2500
- noCollideAll(SnowBall,0)
- O:soundPlay(1,1,"ambient/materials/footsteps_glass1.wav")
- timer("remove",500)
- timer("holo",1200)
- }
- }
- if(changed(O:keyAttack2())&O:keyAttack2()){
- timer("remove",1)
- timer("holo",1)
- }
- if(clk("holo")){
- stoptimer("holo")
- holoUnparent(0)
- holoPos(0,O:attachmentPos("anim_attachment_rh"))
- holoAng(0,O:attachmentAng("anim_attachment_rh"))
- holoParentAttachment(0,O,"anim_attachment_rh")
- }
- if(changed(Just)&Just) {
- setName("Снежок от Artes'a")
- holoPos(0,O:attachmentPos("anim_attachment_rh"))
- holoAng(0,O:attachmentAng("anim_attachment_rh"))
- holoPos(0,holoEntity(0):toWorld(vec(0,0,0)))
- holoParentAttachment(0,O,"anim_attachment_rh")
- } elseif(changed(!Just)&!Just) {
- if(!first()){
- holoUnparent(0)
- holoPos(0,E:pos())
- holoAng(0,E:angles())
- holoParent(0,E)
- }
- }
- if(clk("remove")){
- SnowBall:remove(1)
- stoptimer("removed")
- }
- }
Add Comment
Please, Sign In to add comment