JayGamerz

Untitled

Jul 8th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.30 KB | None | 0 0
  1. g = game.Players.LocalPlayer.Name
  2. j = game.Players[g].Character
  3.  
  4. acc = 2
  5. modes = {"Automatic", "Sniper", "ShotGun", "Burst", "Flame", "Electric"}
  6. modnum = 1
  7. mode = modes[modnum]
  8.  
  9. local la, ra = j.Torso:findFirstChild("Left Shoulder"),j.Torso:findFirstChild("Right Shoulder")
  10. function weld(par, p1, p2, c1, c2)
  11. local w = Instance.new("Weld")
  12. w.Parent = par
  13. w.Part0 = p1
  14. w.Part1 = p2
  15. pcall(function()
  16. w.C0 = c1
  17. w.C1 = c2
  18. end)
  19. return w
  20. end
  21.  
  22. mod = Instance.new("Model", j)
  23. mod.Name = "Mod"
  24.  
  25.  
  26. local lw;
  27. local rw;
  28. local flw;
  29. local frw;
  30. moof = 0
  31.  
  32. fcolor = "Really black"
  33. scolor = "Grey"
  34. dcolor = "Royal blue"
  35.  
  36. left = j["Left Arm"]
  37.  
  38.  
  39. pcall(function()
  40. la.Parent, ra.Parent = nil, nil
  41.  
  42. end)
  43.  
  44.  
  45. fl = Instance.new("Part")
  46. fl.Parent = j
  47. fl.Size = Vector3.new(1, 1, 1)
  48. fl.CanCollide = false
  49. fl.Transparency = 1
  50. fl:BreakJoints()
  51. flw = weld(j.Torso, j.Torso, fl, CFrame.new(-1.1, .5, 0.15))
  52.  
  53. local lw = weld(j.Torso,fl,j["Left Arm"], CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90), 0,
  54.  
  55. math.rad(10)))
  56.  
  57.  
  58.  
  59. fr = Instance.new("Part")
  60. fr.Parent = j
  61. fr.Size = Vector3.new(1, 1, 1)
  62. fr.CanCollide = false
  63. fr.Transparency = 1
  64. fr:BreakJoints()
  65. frw = weld(j.Torso, j.Torso, fr, CFrame.new(.2, .5, -1))
  66.  
  67. local rw = weld(j.Torso,fr,j["Right Arm"], CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90), 0,
  68.  
  69. math.rad(-35)))
  70.  
  71. function cyl(p)
  72. local c = Instance.new("CylinderMesh", p)
  73. return c
  74. end
  75.  
  76. function sph(p)
  77. local c = Instance.new("SpecialMesh", p)
  78. c.MeshType = "Sphere"
  79. return c
  80. end
  81.  
  82. function block(p)
  83. local c = Instance.new("BlockMesh", p)
  84. return c
  85. end
  86.  
  87.  
  88.  
  89. local base = Instance.new("Part")
  90. base.Parent = mod
  91. base.Size = Vector3.new(1, 1, 1)
  92. base:BreakJoints()
  93. base.BrickColor = BrickColor.new(fcolor)
  94. local c = block(base)
  95. c.Scale = Vector3.new(.35, 3, .6)
  96. weld(base, base, left, CFrame.new(-.4, 2, .5)*CFrame.Angles(math.rad(0), math.rad(0),
  97.  
  98. math.rad(10)))
  99.  
  100.  
  101. local a = Instance.new("Part")
  102. a.Parent = mod
  103. a.Size = Vector3.new(1, 1, 1)
  104. a:BreakJoints()
  105. a.BrickColor = BrickColor.new(scolor)
  106. local c = block(a)
  107. c.Scale = Vector3.new(.2, .2, .8)
  108. handle = weld(a, a, base, CFrame.new(0, -.7, -.4)*CFrame.Angles(math.rad(10), math.rad(0), 0))
  109.  
  110. local a2 = Instance.new("Part")
  111. a2.Parent = mod
  112. a2.Size = Vector3.new(1, 1, 1)
  113. a2:BreakJoints()
  114. a2.BrickColor = BrickColor.new(scolor)
  115. local c = block(a2)
  116. c.Scale = Vector3.new(.1, .3, .9)
  117. a2.Name = "Effect"
  118. weld(a2, a2, a, CFrame.new(0, 0, 0))
  119.  
  120. local a = Instance.new("Part")
  121. a.Parent = mod
  122. a.Size = Vector3.new(1, 1, 1)
  123. a:BreakJoints()
  124. a.BrickColor = BrickColor.new(scolor)
  125. local c = block(a)
  126. c.Scale = Vector3.new(.2, .2, .8)
  127. handle2 = weld(a, a, base, CFrame.new(0, .25, -.4)*CFrame.Angles(math.rad(10), math.rad(0), 0))
  128.  
  129. local a2 = Instance.new("Part")
  130. a2.Parent = mod
  131. a2.Size = Vector3.new(1, 1, 1)
  132. a2:BreakJoints()
  133. a2.BrickColor = BrickColor.new(scolor)
  134. local c = block(a2)
  135. c.Scale = Vector3.new(.1, .3, .9)
  136. a2.Name = "Effect"
  137. weld(a2, a2, a, CFrame.new(0, 0, 0))
  138.  
  139.  
  140.  
  141.  
  142. local s = Instance.new("Part")
  143. s.Parent = mod
  144. s.Size = Vector3.new(1, 1, 1)
  145. s:BreakJoints()
  146. s.BrickColor = BrickColor.new(fcolor)
  147. local c = cyl(s)
  148. c.Scale = Vector3.new(.2, 1.4, .2)
  149. weld(s, s, base, CFrame.new(0, 1.5, 0.2)*CFrame.Angles(0, 0, 0))
  150.  
  151.  
  152. local s2 = Instance.new("Part")
  153. s2.Parent = mod
  154. s2.Size = Vector3.new(1, 1, 1)
  155. s2:BreakJoints()
  156. s2.BrickColor = BrickColor.new(scolor)
  157. local c = cyl(s2)
  158. c.Scale = Vector3.new(.3, 1.2, .3)
  159. weld(s2, s2, base, CFrame.new(0, 1.5, 0.2)*CFrame.Angles(0, 0, 0))
  160.  
  161.  
  162.  
  163.  
  164.  
  165. local s22 = Instance.new("Part")
  166. s22.Parent = mod
  167. s22.Size = Vector3.new(1, 1, 1)
  168. s22.BrickColor = BrickColor.new(dcolor)
  169. local c = cyl(s22)
  170. c.Scale = Vector3.new(.15, .95, .15)
  171. s22:BreakJoints()
  172. weld(s, s22, s, CFrame.new(0, -.1, .1)*CFrame.Angles(0, 0, 0))
  173. s22.Name = "Effect"
  174.  
  175.  
  176. local st = Instance.new("Part")
  177. st.Parent = mod
  178. st.Size = Vector3.new(1, 1, 1)
  179. st.BrickColor = BrickColor.new(dcolor)
  180. st:BreakJoints()
  181. weld(st, st, s2, CFrame.new(0, .5, 0)*CFrame.Angles(0, 0, 0))
  182. st.Name = "Tip"
  183. st.Transparency = 1
  184.  
  185. local st2 = Instance.new("Part")
  186. st2.Parent = mod
  187. st2.Size = Vector3.new(1, 1, 1)
  188. st2.BrickColor = BrickColor.new(dcolor)
  189. st2:BreakJoints()
  190. st2.Name = "Tipl"
  191. st2.Transparency = 1
  192. weld(st2, st2, s, CFrame.new(0, .5, -.3)*CFrame.Angles(0, 0, 0))
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. local s = Instance.new("Part")
  203. s.Parent = mod
  204. s.Size = Vector3.new(1, 1, 1)
  205. s:BreakJoints()
  206. s.BrickColor = BrickColor.new(fcolor)
  207. local c = cyl(s)
  208. c.Scale = Vector3.new(.2, 1, .2)
  209. weld(s, s, base, CFrame.new(0, 1.5, -0.1)*CFrame.Angles(0, 0, 0))
  210.  
  211. local s2 = Instance.new("Part")
  212. s2.Parent = mod
  213. s2.Size = Vector3.new(1, 1, 1)
  214. s2:BreakJoints()
  215. s2.BrickColor = BrickColor.new(scolor)
  216. local c = cyl(s2)
  217. c.Scale = Vector3.new(.3, .8, .3)
  218. weld(s2, s2, base, CFrame.new(0, 1.5, -0.1)*CFrame.Angles(0, 0, 0))
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228. for i=1,6 do
  229. local s = Instance.new("Part")
  230. s.Parent = mod
  231. s.Size = Vector3.new(1, 1, 1)
  232. s.BrickColor = BrickColor.new(scolor)
  233. local c = block(s)
  234. c.Scale = Vector3.new(.45, .2, .7)
  235. s:BreakJoints()
  236. weld(s, s, base, CFrame.new(0, -1 + (i*.4), 0.1)*CFrame.Angles(0, 0, 0))
  237.  
  238. local s2 = Instance.new("Part")
  239. s2.Parent = mod
  240. s2.Size = Vector3.new(1, 1, 1)
  241. s2.BrickColor = BrickColor.new(dcolor)
  242. local c = block(s2)
  243. c.Scale = Vector3.new(.5, .1, .75)
  244. s2:BreakJoints()
  245. weld(s, s2, s, CFrame.new(0, 0, 0)*CFrame.Angles(0, 0, 0))
  246. s2.Name = "Effect"
  247.  
  248. end
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. local l = Instance.new("Part")
  259. l.Parent = mod
  260. l.Size = Vector3.new(1, 1, 1)
  261. l:BreakJoints()
  262. l.BrickColor = BrickColor.new(scolor)
  263. l.CanCollide = false
  264. l.formFactor = 0
  265. l.BrickColor = BrickColor.new("Really red")
  266. l.Transparency = .3
  267. local c = cyl(l)
  268. c.Scale = Vector3.new(.3, .8, .3)
  269. c.Name = "c"
  270. l.Name = "Laser"
  271. local w = weld(l, l, st2, CFrame.new(0, 0, 0)*CFrame.Angles(0, 0, 0))
  272. w.Name = "w"
  273. w.Parent = l
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283. for i, v in pairs(mod:GetChildren()) do
  284. v.CanCollide = false
  285. if v.Name == "Effect" then
  286. coroutine.resume(coroutine.create(function()
  287. while true do
  288. for i=1, 25 do
  289. wait()
  290. v.Reflectance = i*4/100
  291. v.Transparency = i*4/100
  292. end
  293. wait()
  294. for i=1,25 do
  295. v.Transparency = i*4/100
  296. v.Reflectance = i*4/100
  297. wait()
  298. end
  299. end
  300. end))
  301. end
  302. end
  303.  
  304. function ChangeColor(color)
  305. for i, v in pairs(mod:GetChildren()) do
  306. if v.Name == "Effect" then
  307. v.BrickColor = BrickColor.new(color)
  308. end
  309. end
  310. end
  311.  
  312.  
  313.  
  314.  
  315.  
  316. if script.Parent.className ~= "HopperBin" then
  317. h = Instance.new("HopperBin")
  318. h.Parent = game.Players[g].Backpack
  319. script.Parent = h
  320.  
  321.  
  322.  
  323.  
  324.  
  325. end
  326.  
  327. rsel = false
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342. las = mod.Laser
  343.  
  344.  
  345. lasw = las.w
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359. function snipe(pos, m)
  360. local l = Instance.new("Part")
  361. l.Parent = j
  362. l.BrickColor = BrickColor.new("Dark green")
  363. l.Anchored = true
  364. l.Size = Vector3.new(1, 1, 1)
  365. l.formFactor = 0
  366.  
  367.  
  368. local c = Instance.new("CylinderMesh")
  369. c.Parent = l
  370. local rand = Vector3.new(math.random(-.1, .1), math.random(-.1, .1), math.random(-.1, .1))
  371. local looky = (mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(0, -999, 0)
  372. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tip.Position+rand, (looky), 999), j)
  373. if a then
  374. a:BreakJoints()
  375. local rot = (a.Position-mod.Tip.Position).magnitude/acc
  376. a.RotVelocity = Vector3.new(math.random(-rot, rot), math.random(-rot, rot), math.random(-rot,
  377.  
  378. rot))
  379.  
  380. if a.Name == "Torso" or a.Name == "Head" then --For perfect shot...
  381. l.CFrame = CFrame.new((a.Position+mod.Tip.Position)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2, 0, 0)
  382.  
  383. c.Scale = Vector3.new(.1, (a.Position-mod.Tip.Position).magnitude, 0.1)
  384. Instance.new("Fire").Parent = a
  385. else
  386. c.Scale = Vector3.new(.1, (b-mod.Tip.Position).magnitude, 0.1)
  387. l.CFrame = CFrame.new((b+mod.Tip.Position+rand)/2,
  388.  
  389. mod.Tip.Position)*CFrame.Angles(math.pi/2, 0, 0)
  390. local chance = math.random(1, 20)
  391.  
  392. if chance == 5 then
  393. for i=1,10 do
  394. local e = Instance.new("Explosion", Workspace)
  395. e.BlastRadius = 30
  396. e.BlastPressure = 8000
  397. e.Position = b+Vector3.new(math.random(-4, 4), math.random(-4, 4), math.random(-4, 4))
  398. e.Hit:connect(function(z)
  399. Instance.new("Fire").Parent = z
  400. if z.Name ~= "Base" then
  401. z.Anchored = false
  402. end
  403. z:BreakJoints()
  404. end)
  405. end
  406. end
  407.  
  408. end
  409. else
  410. c.Scale = Vector3.new(.1, (looky-mod.Tip.Position).magnitude, 0.1)
  411. l.CFrame = CFrame.new((looky+mod.Tip.Position+rand)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  412.  
  413. 0, 0)
  414.  
  415. end
  416.  
  417. coroutine.resume(coroutine.create(function()
  418. for i=0,1,.075 do
  419. l.Transparency = i
  420. wait()
  421. end
  422. l:Remove()
  423. end))
  424. end
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433. function scatter(pos, m)
  434. for i=1,10 do
  435. local l = Instance.new("Part")
  436. l.Parent = j
  437. l.BrickColor = BrickColor.new("Bright yellow")
  438. l.Anchored = true
  439. l.Size = Vector3.new(1, 1, 1)
  440. l.formFactor = 0
  441.  
  442.  
  443. local c = Instance.new("CylinderMesh")
  444. c.Parent = l
  445. local tempacc = acc*3.2
  446. local rand = Vector3.new(math.random(-tempacc, tempacc), math.random(-tempacc, tempacc),
  447.  
  448. math.random(-tempacc, tempacc))
  449. local looky = (mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(0, -999, 0)
  450. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tip.Position+rand, (looky), 999), j)
  451. if a then
  452. a:BreakJoints()
  453. if a.Name ~= "Base" then
  454. a.Anchored = false
  455.  
  456. if a.Name == "Torso" or a.Name == "Head" or a.Parent:findFirstChild("Humanoid") ~= nil then
  457.  
  458.  
  459. l.CFrame = CFrame.new((a.Position+mod.Tip.Position)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  460.  
  461. 0, 0)
  462. c.Scale = Vector3.new(.1, (a.Position-mod.Tip.Position).magnitude, 0.1)
  463.  
  464. Instance.new("Fire").Parent = a
  465. local bf = Instance.new("BodyForce")
  466. bf.Parent = a
  467. bf.force = (a.Position - mod.Tip.Position).unit*math.random(2300, 4300)
  468.  
  469. else
  470. c.Scale = Vector3.new(.1, (b-mod.Tip.Position).magnitude, 0.1)
  471. l.CFrame = CFrame.new((b+mod.Tip.Position+rand)/2,
  472.  
  473. mod.Tip.Position)*CFrame.Angles(math.pi/2, 0, 0)
  474. --[[a.RotVelocity = Vector3.new(math.random(-300, 300), math.random(-300, 300), math.random(-300,
  475.  
  476. 300))]]
  477.  
  478. end
  479. end
  480. else
  481. c.Scale = Vector3.new(.1, (looky-mod.Tip.Position).magnitude, 0.1)
  482. l.CFrame = CFrame.new((looky+mod.Tip.Position+rand)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  483.  
  484. 0, 0)
  485.  
  486. end
  487. coroutine.resume(coroutine.create(function()
  488. for i=0,1,.075 do
  489. l.Transparency = i
  490. wait()
  491. end
  492. l:Remove()
  493. end))
  494.  
  495. end
  496.  
  497.  
  498.  
  499. end
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510. function burst(pos, m)
  511. local l = Instance.new("Part")
  512. l.Parent = j
  513. l.BrickColor = BrickColor.new("Bright blue")
  514. l.Anchored = true
  515. l.Size = Vector3.new(1, 1, 1)
  516. l.formFactor = 0
  517.  
  518.  
  519. local c = Instance.new("CylinderMesh")
  520. c.Parent = l
  521. local tempacc = acc*1.2
  522. local rand = Vector3.new(math.random(-tempacc, tempacc), math.random(-tempacc, tempacc),
  523.  
  524. math.random(-tempacc, tempacc))
  525. local looky = (mod.Tipl.CFrame-mod.Tipl.CFrame.p)*Vector3.new(0, -999, 0)
  526. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tip.Position+rand, (looky), 999), j)
  527. if a then
  528. a:BreakJoints()
  529. a.Reflectance = 1
  530. a.Anchored = true
  531.  
  532. if a.Name == "Torso" or a.Name == "Head" or a.Parent:findFirstChild("Humanoid") ~= nil then
  533.  
  534. --[[For perfect shot...]]
  535.  
  536. l.CFrame = CFrame.new((a.Position+mod.Tip.Position)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  537.  
  538. 0, 0)
  539. c.Scale = Vector3.new(.1, (a.Position-mod.Tip.Position).magnitude, 0.1)
  540.  
  541.  
  542. else
  543. c.Scale = Vector3.new(.1, (b-mod.Tip.Position).magnitude, 0.1)
  544. l.CFrame = CFrame.new((b+mod.Tip.Position+rand)/2,
  545.  
  546. mod.Tip.Position)*CFrame.Angles(math.pi/2, 0, 0)
  547. --[[a.RotVelocity = Vector3.new(math.random(-300, 300), math.random(-300, 300), math.random(-300,
  548.  
  549. 300))]]
  550.  
  551.  
  552. end
  553. else
  554. c.Scale = Vector3.new(.1, (looky-mod.Tip.Position).magnitude, 0.1)
  555. l.CFrame = CFrame.new((looky+mod.Tip.Position+rand)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  556.  
  557. 0, 0)
  558.  
  559. end
  560. coroutine.resume(coroutine.create(function()
  561. for i=0,1,.075 do
  562. l.Transparency = i
  563. wait()
  564. end
  565. l:Remove()
  566. end))
  567.  
  568.  
  569.  
  570.  
  571.  
  572. end
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579. time = 0.001
  580.  
  581. function dop(m)
  582. sele = true
  583.  
  584.  
  585. while sele == true do
  586. if mode == "Automatic" then
  587. fire(m.Hit.p, m)
  588. shootanim()
  589. ChangeColor("Really red")
  590. time = 0.001
  591. elseif mode == "Sniper" then
  592. snipe(m.Hit.p, m)
  593. shootanim()
  594. ChangeColor("Dark green")
  595. time = 1
  596. elseif mode == "ShotGun" then
  597. scatter(m.Hit.p, m)
  598. shootanim()
  599. ChangeColor("Bright yellow")
  600. time = .4
  601. elseif mode == "Burst" then
  602. ChangeColor("Bright blue")
  603. for i=1,4 do
  604. burst(m.Hit.p, m)
  605. time = .7
  606. shootanim()
  607. wait()
  608. end
  609. elseif mode == "Flame" then
  610. flame(m.Hit.p, m)
  611. ChangeColor("Dark orange")
  612. time = .01
  613.  
  614. elseif mode == "Electric" then
  615. electic(m.Hit.p, m)
  616. ChangeColor("Institutional white")
  617. time = .1
  618.  
  619. end
  620.  
  621.  
  622. wait(time)
  623. end
  624. end
  625.  
  626.  
  627.  
  628.  
  629.  
  630. function shootanim()
  631. for i=1,2 do
  632. flw.C0 = flw.C0*CFrame.new(0, 0, 0.3)
  633. frw.C0 = frw.C0*CFrame.new(0, 0, 0.3)
  634. wait()
  635. end
  636.  
  637. for i=1,2 do
  638. flw.C0 = flw.C0*CFrame.new(0, 0, -0.3)
  639. frw.C0 = frw.C0*CFrame.new(0, 0, -0.3)
  640. wait()
  641. end
  642. end
  643.  
  644.  
  645.  
  646. function electic(pos, m)
  647. local rand = Vector3.new(math.random(-acc, acc), math.random(-acc, acc), math.random(-acc, acc))
  648. local looky = (mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(0, -999, 0)
  649. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tip.Position+rand, (looky), 999), j)
  650. if a then
  651. if a.Name == "Ele" then
  652. return
  653. end
  654. elect(b)
  655. coroutine.resume(coroutine.create(function()
  656. wait((mod.Tip.Position-a.Position).magnitude/100)
  657. local last = a.Position
  658. for i=1,25 do
  659. wait()
  660. if a.Name ~= "Base" then
  661. a:BreakJoints()
  662. a.Anchored = false
  663. end
  664. local siz = a.Size + Vector3.new(3, 3, 3)
  665. local new = a.Position+Vector3.new(math.random(-siz.X/2, siz.X/2), math.random(-siz.Y/2, siz.Y/2), math.random(-siz.Z/2, siz.Z/2))
  666. Eff(last, new)
  667. wait()
  668. last = new
  669. end
  670. end))
  671.  
  672. else
  673. elect(mod.Tip.Position + ((mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(0, -20, 0)))
  674. end
  675. end
  676.  
  677.  
  678. function unp(m)
  679. sele = false
  680. ChangeColor("Royal blue")
  681. end
  682.  
  683.  
  684. function key(k)
  685. if k == "q" then
  686. for i=1, 20 do
  687. p = Instance.new("Part", workspace)
  688. p.CFrame = CFrame.new(0, 10+i, 0)
  689. end
  690. end
  691. if k == "e" then
  692. for i=1, 1 do
  693. p = Instance.new("Part", workspace)
  694. p.CFrame = CFrame.new(0, 0, 0)
  695. p.Anchored = true
  696. p.Size = Vector3.new(5, 5, 5)
  697. end
  698. end
  699. if k == "z" then
  700. if modnum > 1 then
  701. modnum = modnum - 1
  702. mode = modes[modnum]
  703. end
  704. end
  705.  
  706. if k == "x" then
  707. if modnum < #modes then
  708. modnum = modnum + 1
  709. mode = modes[modnum]
  710. end
  711. end
  712. end
  713.  
  714.  
  715. function fire(pos, m)
  716. local l = Instance.new("Part")
  717. l.Parent = j
  718. l.BrickColor = BrickColor.new("Really red")
  719. l.Anchored = true
  720. l.Size = Vector3.new(1, 1, 1)
  721. l.formFactor = 0
  722.  
  723.  
  724. local c = Instance.new("CylinderMesh")
  725. c.Parent = l
  726. local rand = Vector3.new(math.random(-acc, acc), math.random(-acc, acc), math.random(-acc, acc))
  727. local looky = (mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(0, -999, 0)
  728. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tip.Position+rand, (looky), 999), j)
  729. if a then
  730. a:BreakJoints()
  731. if a.Name ~= "Base" then
  732. a.Anchored = false
  733. end
  734.  
  735. if a.Name == "Torso" or a.Name == "Head" then --For perfect shot...
  736. l.CFrame = CFrame.new((a.Position+mod.Tip.Position)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  737.  
  738. 0, 0)
  739. c.Scale = Vector3.new(.1, (a.Position-mod.Tip.Position).magnitude, 0.1)
  740. else
  741. c.Scale = Vector3.new(.1, (b-mod.Tip.Position).magnitude, 0.1)
  742. l.CFrame = CFrame.new((b+mod.Tip.Position+rand)/2,
  743.  
  744. mod.Tip.Position)*CFrame.Angles(math.pi/2, 0, 0)
  745. end
  746. else
  747. c.Scale = Vector3.new(.1, (looky-mod.Tip.Position).magnitude, 0.1)
  748. l.CFrame = CFrame.new((looky+mod.Tip.Position+rand)/2, mod.Tip.Position)*CFrame.Angles(math.pi/2,
  749.  
  750. 0, 0)
  751.  
  752. end
  753.  
  754. coroutine.resume(coroutine.create(function()
  755. for i=0,1,.075 do
  756. l.Transparency = i
  757. wait()
  758. end
  759. l:Remove()
  760. end))
  761.  
  762.  
  763. end
  764.  
  765.  
  766. Colors = {"Dark orange", "Bright yellow", "Really red", "Really black"}
  767.  
  768.  
  769. function flame(pos, m)
  770. local l = Instance.new("Part")
  771. l.Parent = j
  772. l.BrickColor = BrickColor.new(Colors[math.random(1, #Colors)])
  773. l.Anchored = true
  774. l.Size = Vector3.new(1, 1, 1)
  775. block(l)
  776. local f = Instance.new("Fire", l)
  777. f.Color = Color3.new(0, 0, 1)
  778.  
  779. local st = (mod.Tip.CFrame-mod.Tip.CFrame.p)*Vector3.new(math.random(-1, 1), -2, math.random(-1, 1))
  780. l.CFrame = (mod.Tip.CFrame + Vector3.new(CFrame.new(st)))
  781. --[[*CFrame.Angles(math.rad(math.random(-20, 20)), math.rad(math.random(-20, 20)), math.rad(math.random(-20, 20))) ))]]
  782.  
  783. l.CFrame = l.CFrame*CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)))
  784.  
  785. coroutine.resume(coroutine.create(function()
  786. for i=1,math.random(6, 9) do
  787. wait()
  788. l.CFrame = l.CFrame+Vector3.new(st.X, st.Y/4, st.Z)
  789. l.CFrame = l.CFrame + Vector3.new(0, i*0.2, 0)
  790. l.CFrame = l.CFrame*CFrame.Angles(math.rad(i), math.rad(i), math.rad(i))
  791. l.Transparency = l.Transparency + 0.1
  792. local a, b = Workspace:FindPartOnRay(Ray.new(l.Position, l.CFrame.lookVector*5, 994), j)
  793. if a then
  794. if a.Name ~= "Base" then
  795. local p = Instance.new("Part")
  796. p.Parent = a
  797. p.CanCollide = false
  798. p:BreakJoints()
  799. p.Transparency = 1
  800. p.Size = Vector3.new(1, 1, 1)
  801. p.CFrame = CFrame.new(b.X, b.Y, b.Z)
  802. p.Anchored = true
  803. local f = Instance.new("Fire", p)
  804. Instance.new("Fire").Parent = a
  805. f.Color = Color3.new(0, 0, 1)
  806. a.BrickColor = BrickColor.new("Really black")
  807. a.Anchored = false
  808. a:BreakJoints()
  809. l:Remove()
  810. --weld(p, p, a, CFrame.new(b.X, b.Y, b.Z))
  811. break
  812. end
  813. end
  814. end
  815. pcall(function()
  816. l:Remove()
  817. end)
  818.  
  819.  
  820. end))
  821.  
  822.  
  823.  
  824. end
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831. coroutine.resume(coroutine.create(function()
  832. while true do
  833. wait()
  834. local looky = (mod.Tipl.CFrame-mod.Tipl.CFrame.p)*Vector3.new(0, -999, 0)
  835.  
  836. local a, b = Workspace:FindPartOnRay(Ray.new(mod.Tipl.Position, (looky), 999), j)
  837. if a then
  838. if a.Name ~= "Ele" then
  839. las.c.Scale = Vector3.new(.1,(mod.Tipl.Position-b).magnitude, .1)
  840. las.c.Offset = Vector3.new(0, -(b - mod.Tipl.Position).magnitude/2, 0)
  841. --lasw.C0 = CFrame.new(0, (b - mod.Tipl.Position).magnitude/2, 0)
  842. lasw.C0 = CFrame.new(0, 0, 0)
  843. end
  844. else
  845. las.c.Scale = Vector3.new(.1, 1000, .1)
  846. --lasw.C0 = CFrame.new(0, 500, 0)
  847. lasw.C0 = CFrame.new(0, 0, 0)
  848. las.c.Offset = Vector3.new(0, -500, 0)
  849. end
  850.  
  851. end
  852. end))
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861. function Eff(last, rand)
  862. local p = Instance.new("Part")
  863. p.Parent = Workspace
  864. p.Name = "Ele"
  865. p.Size = Vector3.new(1, 1, 1)
  866. p.Anchored = true
  867. p.formFactor = 0
  868. p.BrickColor = BrickColor.new("Bright yellow")
  869. p.CanCollide = false
  870. local c = Instance.new("CylinderMesh")
  871. c.Parent = p
  872. c.Scale = Vector3.new(.1, (last-rand).magnitude, .1)
  873. p.CFrame = CFrame.new((last+rand)/2, last)*CFrame.Angles(math.pi/2, 0, 0)
  874. coroutine.resume(coroutine.create(function()
  875. for i=0, 1, .075 do
  876. p.Transparency = i
  877. wait()
  878. end
  879. p:Remove()
  880. end))
  881.  
  882. end
  883.  
  884.  
  885.  
  886.  
  887.  
  888. function elect(pos)
  889. local targ = pos
  890.  
  891.  
  892. part = mod.Tip
  893. local change = 2
  894.  
  895.  
  896.  
  897.  
  898. local last = part.Position
  899. coroutine.resume(coroutine.create(function()
  900. while true do
  901. local fast = math.random(1, 4)
  902. if fast == 3 then
  903. wait()
  904. end
  905. local un = (targ-last).unit
  906. if (last-targ).magnitude < 10 then
  907. new = targ
  908. Eff(last, new)
  909. break
  910. else
  911. local new = last+((un*5)+Vector3.new(math.random(-change, change), math.random(-change, change), math.random(-change, change)))
  912. Eff(last, new)
  913. last = new
  914. end
  915. end
  916. end))
  917.  
  918. end
  919.  
  920.  
  921.  
  922.  
  923. function sel(m)
  924. rsel = true
  925.  
  926. coroutine.resume(coroutine.create(function()
  927. while true do
  928. wait()
  929.  
  930. if m.Target ~= nil then
  931. moof = m.Hit
  932.  
  933. if rsel == true then
  934. lw.C0 = CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90+moof.Y), math.rad(0), math.rad(10))
  935. rw.C0 = CFrame.new(0, 0, 0)*CFrame.Angles(math.rad(90+moof.Y), math.rad(0), math.rad(-35))
  936. end
  937. end
  938. end
  939. end))
  940.  
  941.  
  942. m.Button1Down:connect(function() dop(m) end)
  943. m.Button1Up:connect(function() unp(m) end)
  944. m.KeyDown:connect(function(k) key(k) end)
  945.  
  946. end
  947. script.Parent.Selected:connect(sel) --lego
  948.  
  949. function dsel(m)
  950. rsel = false
  951.  
  952. end
  953. script.Parent.Deselected:connect(dsel) --lego
Add Comment
Please, Sign In to add comment