Guest User

Untitled

a guest
Jul 28th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.78 KB | None | 0 0
  1. function init()
  2.    
  3.     RegisterTool("grimorio", "Grimoire", "MOD/vox/katana.vox")
  4.     SetBool("game.tool.grimorio.enabled", true)
  5.  
  6.     magicpentagram = LoadSprite("MOD/sprites/magicCircle.png")
  7.     magicgravity1 = LoadSprite("MOD/sprites/magicgravity1.png")
  8.     magicgravity2 = LoadSprite("MOD/sprites/magicgravity2.png")
  9.     magicorange = LoadSprite("MOD/sprites/magicorange.png")
  10.     lowgravpng = LoadSprite("MOD/sprites/lowgrav.png")
  11.     vortexSprite = LoadSprite("MOD/sprites/blackmagic.png")
  12.  
  13.     interface = LoadSprite("MOD/sprites/Interface.png")
  14.     interface1 = LoadSprite("MOD/sprites/Interface1.png")
  15.     interface2 = LoadSprite("MOD/sprites/Interface2.png")
  16.     interface3 = LoadSprite("MOD/sprites/Interface3.png")
  17.    
  18.     gravitybass = LoadSound("MOD/snd/bass.ogg")
  19.  
  20.     beam = LoadLoop("MOD/snd/beam.ogg")
  21.     beam1 = LoadLoop("MOD/snd/beam1.ogg")
  22.     blackhole = LoadLoop("MOD/snd/blackhole.ogg")
  23.     whitehole = LoadLoop("MOD/snd/whitehole.ogg")
  24.  
  25.     SetFloat("game.tool.grimorio.ammo", -1)
  26.    
  27.     lightbeam = true
  28.     gravityImpact = false
  29.     rayo = false
  30.     lowgrav = false
  31.     cleanVortex = false
  32.    
  33.     circlegravity = 4
  34.     alturamax = 100
  35.  
  36.     invetario = 1
  37.     disparosmax = 4
  38.     invetario = 1
  39.     disparos = 0
  40.    
  41.     invetario = 1
  42.  
  43.    
  44.  
  45.  
  46.  
  47. end
  48.  
  49. function tick(dt)
  50.  
  51.     if  GetString("game.player.tool") == "grimorio" then
  52.            
  53.    
  54.         local t = GetCameraTransform()
  55.         local cameraPoint = Vec(0,0,-1)
  56.         local p = TransformToParentPoint(t, cameraPoint)
  57.         direction = VecSub(p,t.pos)
  58.         raycasthit(direction,t.pos,1,30)
  59.        
  60.        
  61.         if InputPressed("lmb")then             
  62.            
  63.             if gravityImpact and not gravityShoot then
  64.                 makeGravity()
  65.                 gravityShoot = true
  66.             end
  67.         end
  68.        
  69.         if InputDown("rmb") then
  70.  
  71.             if cleanVortex and not sucking then
  72.  
  73.                 pushing = true
  74.                 cVortex(5, 0.3, -0.5, 1, 1, 1)
  75.  
  76.             end
  77.            
  78.         else
  79.             if cleanVortex then
  80.                 pushing = false
  81.             end
  82.         end
  83.  
  84.  
  85.        
  86.        
  87.         if InputDown("lmb") then
  88.             if lightbeam then
  89.                 lineaDibujada = true
  90.             end
  91.            
  92.             if rayo then
  93.                 disparorayo()
  94.             end
  95.             if lowgrav then
  96.                 lowgravity()
  97.             end
  98.  
  99.             if cleanVortex and not pushing then
  100.                 cVortex(5, 0.3, 0.1, 0)
  101.                 sucking = true
  102.             end
  103.  
  104.         else
  105.             if lineaDibujada then
  106.                 lineaDibujada = false
  107.             end
  108.              
  109.             if cleanVortex and not pushing then
  110.                 cVortex(0.5, 0.3, 0 ,0, 0, 0)
  111.                 sucking = false
  112.             end
  113.            
  114.            
  115.         end
  116.        
  117.         if gravityImpact then
  118.    
  119.             if gravityShoot == false then
  120.             circlepreview()
  121.             end
  122.         else
  123.             gravityImpact = false
  124.             gravityShoot = false
  125.         end
  126.        
  127.         if InputPressed("g") then
  128.             funInventario()
  129.         end
  130.        
  131.        
  132.        
  133.         if lightbeam then
  134.            puntoToLook = TransformToParentPoint(GetCameraTransform(), Vec(0, 0, -50))
  135.            local eye = GetCameraTransform()
  136.            local wpos = Transform(TransformToParentPoint(GetCameraTransform(), Vec(0.7, 0.2, -0.5)), QuatLookAt(TransformToParentPoint(GetCameraTransform(), Vec(0.5, 0.2, -0.5)), puntoToLook))
  137.            local wpos1 = Transform(TransformToParentPoint(GetCameraTransform(), Vec(-0.7, 0.2, -0.5)), QuatLookAt(TransformToParentPoint(GetCameraTransform(), Vec(0.5, 0.2, -0.5)), puntoToLook))
  138.             DrawSprite(magicpentagram,wpos, 0.5, 0.5, 1, 1, 1, 0.8, true)
  139.             DrawSprite(magicpentagram,wpos1, 0.5, 0.5, 1, 1, 1, 0.8, true)
  140.         end
  141.        
  142.         if rayo then
  143.            local rayocircle = Transform(Vec(rayhit[1], rayhit[2] + 20, rayhit[3]), QuatEuler(90, GetTime() * -8, 0))
  144.            local rayocircle1 = Transform(Vec(rayhit[1], rayhit[2] + 25, rayhit[3]), QuatEuler(90, GetTime() * 8, 0))
  145.            local rayocircle2 = Transform(Vec(rayhit[1], rayhit[2] + 0.2, rayhit[3]), QuatEuler(90, GetTime() * 1000, 0))
  146.             DrawSprite(magicorange,rayocircle, 10, 10, 1, 1, 1, 1, true)
  147.             DrawSprite(magicorange,rayocircle1, 20, 20, 1, 1, 1, 1, true)
  148.             DrawSprite(magicorange,rayocircle2, 5, 5, 1, 1, 1, 1, true)
  149.  
  150.         end
  151.         if lowgrav then
  152.             local rayocircle = Transform(Vec(rayhit[1], rayhit[2] + 20, rayhit[3]), QuatEuler(90, GetTime() * -8, 0))
  153.             local rayocircle1 = Transform(Vec(rayhit[1], rayhit[2] + 25, rayhit[3]), QuatEuler(90, GetTime() * 8, 0))
  154.             local rayocircle2 = Transform(Vec(rayhit[1], rayhit[2] + 0.2, rayhit[3]), QuatEuler(90, GetTime() * 1000, 0))
  155.              DrawSprite(lowgravpng,rayocircle, 10, 10, 1, 1, 1, 1, true)
  156.              DrawSprite(lowgravpng,rayocircle1, 20, 20, 1, 1, 1, 1, true)
  157.              DrawSprite(lowgravpng,rayocircle2, 5, 5, 1, 1, 1, 1, true)
  158.  
  159.          end
  160.  
  161.         if gravityImpact and gravityShoot then
  162.            
  163.             local gravitypos1 = Transform(Vec(rayhit[1], rayhit[2] + 0.2, rayhit[3]), QuatEuler(90, GetTime() * 18, 0))
  164.             local gravitypos2 = Transform(Vec(rayhit[1], rayhit[2] + 0.2, rayhit[3]), QuatEuler(90, 0, 0))
  165.             DrawSprite(magicgravity1,gravitypos1,circlegravity * 2, circlegravity * 2, colorgravity, colorgravity, colorgravity, 0.8, true)
  166.             DrawSprite(magicgravity2,gravitypos2,circlegravity * 2, circlegravity * 2, colorgravity, colorgravity, colorgravity, 0.8, true)
  167.            
  168.             if timerimpact <= GetTime() then   
  169.                 colorgravity = 1
  170.                 makeGravity()
  171.                
  172.             end    
  173.            
  174.              
  175.             if  timercolor <= GetTime() then
  176.                 colorgravity = 0.5
  177.             end
  178.         end
  179.  
  180.    
  181.  
  182. end
  183. end
  184.    
  185.     function draw()
  186.    
  187.         if  GetString("game.player.tool") == "grimorio" then   
  188.        
  189.            
  190.  
  191.             if lightbeam then
  192.                 UiPush()
  193.                 UiTranslate(UiCenter() + 500, UiMiddle() - 500)
  194.                 UiScale(0.5)
  195.                 UiImage("MOD/sprites/Interface.png", 0.5, 0.5)
  196.                 UiPop()
  197.                 --Center
  198.                 UiPush()
  199.                 UiTranslate(UiCenter() + 603, UiMiddle() - 478)
  200.                 UiScale(0.25)
  201.                 UiImage("MOD/sprites/magicCircle.png", 0.5, 0.5)
  202.                 UiPop()
  203.                 --Left/Izquierda
  204.                 UiPush()
  205.                 UiTranslate(UiCenter() + 513, UiMiddle() - 435)
  206.                 UiScale(0.12)
  207.                 UiImage("MOD/sprites/lowgrav.png", 0.5, 0.5)
  208.                 UiPop()
  209.                 --Right/Derecha
  210.                 UiPush()
  211.                 UiTranslate(UiCenter() + 776, UiMiddle() - 435)
  212.                 UiScale(0.12)
  213.                 UiImage("MOD/sprites/magicgravity_interface.png", 0.5, 0.5)
  214.                 UiPop()
  215.                 -- G
  216.                 UiPush()
  217.                 UiTranslate(UiCenter() + 667, UiMiddle() - 336)
  218.                 UiScale(0.3)
  219.                 UiImage("MOD/sprites/G.png", 0.5, 0.5)
  220.                 UiPop()
  221.        
  222.        
  223.         end
  224.  
  225.        
  226.  
  227.     if gravityImpact then
  228.         UiPush()
  229.         UiTranslate(UiCenter() + 500, UiMiddle() - 500)
  230.         UiScale(0.5)
  231.         UiImage("MOD/sprites/Interface.png", 0.5, 0.5)
  232.         UiPop()
  233.         --Center
  234.         UiPush()
  235.         UiTranslate(UiCenter() + 603, UiMiddle() - 478)
  236.         UiScale(0.25)
  237.         UiImage("MOD/sprites/magicgravity_interface.png", 0.5, 0.5)
  238.         UiPop()
  239.         --Left/Izquierda
  240.         UiPush()
  241.         UiTranslate(UiCenter() + 513, UiMiddle() - 435)
  242.         UiScale(0.12)
  243.         UiImage("MOD/sprites/magicCircle.png", 0.5, 0.5)
  244.         UiPop()
  245.         --Right/Derecha
  246.         UiPush()
  247.         UiTranslate(UiCenter() + 776, UiMiddle() - 435)
  248.         UiScale(0.12)
  249.         UiImage("MOD/sprites/magicorange.png", 0.5, 0.5)
  250.         UiPop()
  251.         -- G
  252.         UiPush()
  253.         UiTranslate(UiCenter() + 667, UiMiddle() - 336)
  254.         UiScale(0.3)
  255.         UiImage("MOD/sprites/G.png", 0.5, 0.5)
  256.         UiPop()
  257.        
  258.         end
  259.  
  260.         if rayo then
  261.             UiPush()
  262.             UiTranslate(UiCenter() + 500, UiMiddle() - 500)
  263.             UiScale(0.5)
  264.             UiImage("MOD/sprites/Interface.png", 0.5, 0.5)
  265.             UiPop()
  266.             --Center
  267.             UiPush()
  268.             UiTranslate(UiCenter() + 603, UiMiddle() - 478)
  269.             UiScale(0.25)
  270.             UiImage("MOD/sprites/magicorange.png", 0.5, 0.5)
  271.             UiPop()
  272.             --Left/Izquierda
  273.             UiPush()
  274.             UiTranslate(UiCenter() + 513, UiMiddle() - 435)
  275.             UiScale(0.12)
  276.             UiImage("MOD/sprites/magicgravity_interface.png", 0.5, 0.5)
  277.             UiPop()
  278.             --Right/Derecha
  279.             UiPush()
  280.             UiTranslate(UiCenter() + 776, UiMiddle() - 435)
  281.             UiScale(0.12)
  282.             UiImage("MOD/sprites/blackmagic.png", 0.5, 0.5)
  283.             UiPop()
  284.             -- G
  285.             UiPush()
  286.             UiTranslate(UiCenter() + 667, UiMiddle() - 336)
  287.             UiScale(0.3)
  288.             UiImage("MOD/sprites/G.png", 0.5, 0.5)
  289.             UiPop()
  290.        
  291.             end
  292.             if lowgrav then
  293.                 UiPush()
  294.                 UiTranslate(UiCenter() + 500, UiMiddle() - 500)
  295.                 UiScale(0.5)
  296.                 UiImage("MOD/sprites/Interface.png", 0.5, 0.5)
  297.                 UiPop()
  298.                 --Center
  299.                 UiPush()
  300.                 UiTranslate(UiCenter() + 603, UiMiddle() - 478)
  301.                 UiScale(0.25)
  302.                 UiImage("MOD/sprites/lowgrav.png", 0.5, 0.5)
  303.                 UiPop()
  304.                 --Left/Izquierda
  305.                 UiPush()
  306.                 UiTranslate(UiCenter() + 513, UiMiddle() - 435)
  307.                 UiScale(0.12)
  308.                 UiImage("MOD/sprites/blackmagic.png", 0.5, 0.5)
  309.                 UiPop()
  310.                 --Right/Derecha
  311.                 UiPush()
  312.                 UiTranslate(UiCenter() + 776, UiMiddle() - 435)
  313.                 UiScale(0.12)
  314.                 UiImage("MOD/sprites/magicCircle.png", 0.5, 0.5)
  315.                 UiPop()
  316.                 -- G
  317.                 UiPush()
  318.                 UiTranslate(UiCenter() + 667, UiMiddle() - 336)
  319.                 UiScale(0.3)
  320.                 UiImage("MOD/sprites/G.png", 0.5, 0.5)
  321.                 UiPop()
  322.            
  323.             end
  324.  
  325.             if cleanVortex then
  326.                 UiPush()
  327.                 UiTranslate(UiCenter() + 500, UiMiddle() - 500)
  328.                 UiScale(0.5)
  329.                 UiImage("MOD/sprites/Interface.png", 0.5, 0.5)
  330.                 UiPop()
  331.                 --Center
  332.                 UiPush()
  333.                 UiTranslate(UiCenter() + 603, UiMiddle() - 478)
  334.                 UiScale(0.25)
  335.                 UiImage("MOD/sprites/blackmagic.png", 0.5, 0.5)
  336.                 UiPop()
  337.                 --Left/Izquierda
  338.                 UiPush()
  339.                 UiTranslate(UiCenter() + 513, UiMiddle() - 435)
  340.                 UiScale(0.12)
  341.                 UiImage("MOD/sprites/magicorange.png", 0.5, 0.5)
  342.                 UiPop()
  343.                 --Right/Derecha
  344.                 UiPush()
  345.                 UiTranslate(UiCenter() + 776, UiMiddle() - 435)
  346.                 UiScale(0.12)
  347.                 UiImage("MOD/sprites/lowgrav.png", 0.5, 0.5)
  348.                 UiPop()
  349.                 -- G
  350.                 UiPush()
  351.                 UiTranslate(UiCenter() + 667, UiMiddle() - 336)
  352.                 UiScale(0.3)
  353.                 UiImage("MOD/sprites/G.png", 0.5, 0.5)
  354.                 UiPop()
  355.                
  356.             end
  357.  
  358.  
  359.  
  360.         end
  361.     end
  362.    
  363.     function update(dt)
  364.  
  365.             if lineaDibujada and not gravityImpact then        
  366.                 makeLine()
  367.                 setPoints()
  368.                 PlayLoop(beam, puntoA, 0.5)
  369.                 PlayLoop(beam1, puntoA, 1)
  370.             end
  371.  
  372.         end
  373.  
  374.         DebugPrint(nPuntos)
  375.        
  376.     function funInventario()   
  377.        
  378.         invetario = 1 + invetario
  379.        
  380.         if invetario == 1 then
  381.            
  382.             lightbeam = true
  383.            
  384.         else
  385.             lightbeam = false
  386.         end
  387.        
  388.         if invetario == 2 then
  389.            
  390.             gravityImpact = true
  391.            
  392.         else
  393.             gravityImpact = false
  394.         end    
  395.                
  396.         if invetario == 3 then
  397.            
  398.             rayo = true
  399.            
  400.         else
  401.             rayo = false
  402.         end    
  403.        
  404.         if invetario == 4 then
  405.            
  406.             cleanVortex = true
  407.            
  408.         else
  409.             cleanVortex = false
  410.         end
  411.  
  412.         if invetario == 5 then
  413.            
  414.             lowgrav = true
  415.            
  416.         else
  417.             lowgrav = false
  418.         end    
  419.         if invetario >= 6 then
  420.                 invetario = 0
  421.                 funInventario()
  422.    
  423.         end
  424.     end
  425.  
  426.    
  427.    
  428.     function raycasthit(direction,position,size)
  429.         local hit, dist, normal, shape = QueryRaycast(position, direction, 500)
  430.         if hit then
  431.             if not gravityShoot then
  432.             publicHit = true
  433.             distance = dist
  434.             rayhit = VecAdd(VecScale(direction,dist),position)
  435.         end
  436.         else
  437.             if not gravityShoot then
  438.             rayhit = TransformToParentPoint(GetCameraTransform(), Vec(0, 0, -50))
  439.             end
  440.             publicHit = false
  441.         end
  442.     end
  443.  
  444.  
  445.     function cVortex(radio, alpha,push,color1 ,color2, color3)
  446.        
  447.         pushScale = push
  448.  
  449.         local vSprite = Transform(Vec(rayhit[1], rayhit[2] + 0.3, rayhit[3]), QuatEuler(90, GetTime() * 10, 0))
  450.         DrawSprite(vortexSprite,vSprite, 10, 10, 1, 1, 1, 1, true)
  451.  
  452.         local puntoVortex = Vec(rayhit[1], rayhit[2] + 5, rayhit[3])
  453.  
  454.         p1 = VecAdd(puntoVortex, Vec(-radio * 4, -radio * 4, -radio * 4))
  455.         p2 = VecAdd(puntoVortex, Vec(radio * 4, radio * 4, radio * 4))
  456.         p3 = VecAdd(puntoVortex, Vec(-radio * 0.8, -radio * 0.8, -radio * 0.8))  
  457.         p4 = VecAdd(puntoVortex, Vec(radio * 0.8, radio * 0.8, radio * 0.8))  
  458.  
  459.         QueryRequire("physical dynamic")
  460.         local debries = QueryAabbBodies(p1, p2)
  461.  
  462.         for i=1,#debries do
  463.         local b = debries[i]
  464.  
  465.         local Bminimo, BMaximo = GetBodyBounds(b)
  466.         local bc = VecLerp(Bminimo, BMaximo, 0.5)
  467.         local dir = VecSub(puntoVortex, bc)
  468.  
  469.         local bp = GetBodyTransform(b)
  470.         local add = VecScale(dir, pushScale)
  471.         local vel = GetBodyVelocity(b)
  472.         vel = VecAdd(vel, add)
  473.         SetBodyVelocity(b, vel)
  474.         end
  475.        
  476.         if pushing then
  477.             PlayLoop(whitehole, puntoVortex, 1)
  478.         end
  479.        
  480.        
  481.        
  482.         if sucking then
  483.         PlayLoop(blackhole, puntoVortex, 0.3)
  484.         QueryRequire("physical dynamic")
  485.         local debriesdel = QueryAabbBodies(p3, p4)
  486.        
  487.         for i=1,#debriesdel do
  488.             local b = debriesdel[i]
  489.        
  490.             Delete(b)
  491.            
  492.             end
  493.  
  494.         end
  495.         ParticleCollide(0)
  496.         ParticleRadius(radio)
  497.         ParticleColor(color1, color2, color3)
  498.         ParticleType("fire")
  499.         ParticleAlpha(alpha)
  500.         SpawnParticle(puntoVortex, Vec(0, 0, 0), 0.1)
  501.         ParticleReset()
  502.         ParticleCollide(0)
  503.         ParticleType("fire")
  504.         ParticleRadius(radio / 2)
  505.         ParticleColor(0.29, 0, 0.51)
  506.         SpawnParticle(puntoVortex, Vec(0, 0, 0), 0.1)
  507.     end
  508.    
  509.     function disparorayo()
  510.  
  511.         for lugargolpe = -100, alturamax, 1 do
  512.             local impact = Vec(rayhit[1], rayhit[2] + lugargolpe, rayhit[3])
  513.            
  514.                 Explosion(impact, 0.5)
  515.                
  516.             end
  517.         for lugargolpe = -100, alturamax, 0.5 do   
  518.             local impact = Vec(rayhit[1], rayhit[2] + lugargolpe, rayhit[3])
  519.            
  520.                 ParticleType("fire")
  521.                 ParticleCollide(0)
  522.                 ParticleAlpha(0.3)
  523.                 ParticleColor(1, 0.65, 0)
  524.                 SpawnParticle(impact,Vec(0,-0.2,0), 0.05)
  525.                
  526.             end
  527.  
  528.     end
  529.    
  530.  
  531.  
  532.     function makeGravity()
  533.  
  534.         if disparos <= disparosmax - 1 then
  535.             PlaySound(gravitybass, rayhit, 0.2)
  536.         for lugargolpe = -100, alturamax, 2 do
  537.             local impact = Vec(rayhit[1], rayhit[2] + lugargolpe, rayhit[3])
  538.            
  539.                 MakeHole(impact, 6, 6, 6, true)
  540.        
  541.                 end
  542.                
  543.        
  544.             for lugargolpe = -100, alturamax, 5 do
  545.                 local impact = Vec(rayhit[1], rayhit[2] + lugargolpe, rayhit[3])
  546.        
  547.                     local gravitypos1 = Transform(Vec(impact[1], impact[2], impact[3]), QuatEuler(90, 0, 0))
  548.                     DrawSprite(magicgravity2,gravitypos1,circlegravity * 2, circlegravity * 2, colorgravity, colorgravity, colorgravity, 0.8, true)
  549.            
  550.                 end
  551.             end
  552.        
  553.         if disparos <= disparosmax then
  554.             timerimpact = GetTime() + 1
  555.             timercolor =  GetTime() + 0.2
  556.             disparos = disparos + 1
  557.         end
  558.        
  559.         if disparos == disparosmax + 1 then
  560.             gravityShoot = false
  561.             disparos = 0
  562.         end
  563.  
  564.     end
  565.        
  566.        
  567.     function lowgravity()
  568.  
  569.         local effectpos = rayhit
  570.         local range = 2
  571.  
  572.  
  573.  
  574.         local minPos = VecAdd(effectpos, Vec(-range, -range, -range))
  575.         local maxPos = VecAdd(effectpos, Vec(range, range, range))
  576.         local shapeList = QueryAabbBodies(minPos, maxPos)
  577.  
  578.         for i = 1, #shapeList do
  579.             local shapeBody = shapeList[i]
  580.  
  581.             if IsBodyDynamic(shapeBody) then
  582.  
  583.            
  584.                 local bodyVelocity = GetBodyVelocity(shapeBody)
  585.  
  586.                 bodyVelocity[2] = 0.5
  587.  
  588.                 SetBodyVelocity(shapeBody, bodyVelocity)
  589.             end
  590.         end
  591.  
  592.     end
  593.  
  594.            
  595.  
  596.  
  597.  
  598.  
  599.            
  600.            
  601.            
  602.  
  603.     function circlepreview()
  604.  
  605.         local intervalo = 360 / 40
  606.            
  607.             for degrees = 1, 360, intervalo do
  608.                 local x = rayhit[1] + circlegravity * math.sin(degrees)
  609.                 local z = rayhit[3] + circlegravity * math.cos(degrees)
  610.                 local hitPosition = Vec(x, rayhit[2],z)
  611.                
  612.                 ParticleReset()
  613.                 ParticleColor(0,0.7,1)
  614.                 ParticleType("smoke")
  615.                 ParticleRadius(0.1)
  616.                 ParticleGravity(-1)
  617.                 ParticleCollide(0)
  618.                 SpawnParticle(hitPosition,Vec(0,-0.2,0), 1, 1)
  619.                
  620.                
  621.             end
  622.        
  623.            
  624.         end
  625.  
  626.        
  627.  
  628.  
  629.     function makeLine()
  630.  
  631.     for puntoCentral = 0, 1,  0.01 do
  632.         local pc = VecLerp(rayhit, puntoA, puntoCentral)
  633.         ParticleEmissive(1)
  634.         ParticleColor(1,0.84,0)
  635.         ParticleRadius(0.1 * puntoCentral * 4)
  636.         ParticleCollide(0)
  637.         SpawnParticle(pc, Vec(0,0,0), 0.05)
  638.         SpawnFire(pc)
  639.         MakeHole(pc, 0.1 * puntoCentral * 4 , 0.1 * puntoCentral * 4 , 0.1 * puntoCentral * 4)
  640.     end
  641.  
  642.     for puntoCentral1 = 0, 1,  0.01 do
  643.         local pc = VecLerp(rayhit, puntoC, puntoCentral1)
  644.         ParticleEmissive(1)
  645.         ParticleColor(1,0.84,0)
  646.         ParticleRadius(0.1 * puntoCentral1 * 4)
  647.         ParticleCollide(0)
  648.         SpawnParticle(pc, Vec(0,0,0), 0.05)
  649.         SpawnFire(pc)
  650.         MakeHole(pc, 0.1 * puntoCentral1 * 4 , 0.1 * puntoCentral1 * 4 , 0.1 * puntoCentral1 * 4)
  651.     end
  652.  
  653.        
  654.        
  655.  
  656.         if distance >= 40 then
  657.         beamRadius = 1 / (distance / 40)
  658.         else
  659.             beamRadius = 1
  660.         end
  661.         MakeHole(rayhit, beamRadius , beamRadius , beamRadius)
  662.         if publicHit then
  663.             Explosion(rayhit, 0.5)
  664.         end
  665.        
  666.  
  667. end
  668.  
  669.  
  670.  
  671.  
  672. function setPoints()
  673.  
  674.     puntoB = TransformToParentPoint(rayhit, Vec(0, 0, 0))
  675.     puntoA = TransformToParentPoint(GetCameraTransform(), Vec(2.5, 0.7, -1))
  676.     puntoC = TransformToParentPoint(GetCameraTransform(), Vec(-2.5, 0.7, -1))
  677.  
  678. end
  679.  
  680.  
  681.  
  682.    
  683.    
  684.    
Advertisement
Add Comment
Please, Sign In to add comment