Advertisement
mathmasterphil

Shadow

Mar 3rd, 2015
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. local Me = game.Players.LocalPlayer
  2. Attkin = false
  3. if script.Parent.className ~= "HopperBin" then
  4. local h = Instance.new("HopperBin", Me.Backpack)
  5. h.Name = "Fire/Shadow"
  6. script.Parent = h
  7. end
  8. local bin = script.Parent
  9. me2 = Me.Character
  10. function RC(Pos, Dir, Max, Ignore)
  11. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  12. end
  13. function RayC(Start, En, MaxDist, Ignore)
  14. return RC(Start, (En - Start), MaxDist, Ignore)
  15. end
  16. function onSelected(mouse)
  17. mouse.Button1Down:connect(function()
  18. shot = Instance.new("Part")
  19. shot.Parent = me2
  20. shot.CanCollide = false
  21. shot.Anchored = true
  22. shot.Size = Vector3.new(2, 2, 2)
  23. shot.Transparency = 0.5
  24. shot.BrickColor = BrickColor.new("Black")
  25. local mesh = Instance.new("SpecialMesh")
  26. mesh.Parent = shot
  27. mesh.MeshType = "Sphere"
  28. local start = CFrame.new(me2.Torso.Position) + Vector3.new(0, 3, 0)
  29. local ending = mouse.Hit.p
  30. local face = CFrame.new(start.p, ending)
  31. shot.CFrame = face
  32. local magn = (start.p - ending).magnitude
  33. local lastP = start.p
  34. for i = 4, 300, 8 do
  35. face = face * CFrame.new(0, 0, -8)
  36. shot.CFrame = face
  37. local mag = (lastP - face.p).magnitude
  38. local t = Instance.new("Part",me2)
  39. t.Anchored = true
  40. t.BrickColor = BrickColor.new("Really black")
  41. t.formFactor = "Custom"
  42. t.Size = Vector3.new(1, 1, 1)
  43. local mm = Instance.new("BlockMesh",t)
  44. mm.Scale = Vector3.new(1, 1, mag)
  45. t.CFrame = CFrame.new(lastP, face.p) * CFrame.new(0, 0, -mag/2)
  46. coroutine.resume(coroutine.create(function()
  47. wait(0.05)
  48. for i = 0, 1, 0.1 do
  49. t.Transparency = i
  50. mm.Scale = Vector3.new(0.4-0.4*i, 0.4-0.4*i, mag)
  51. wait()
  52. end
  53. t:remove()
  54. end))
  55. local hit, pos = RayC(lastP, face.p, 14, me2)
  56. if hit then
  57. local h = hit.Parent:findFirstChild("Humanoid")
  58. if h then
  59. h.Health = h.Health - math.random(15, 35)
  60. end
  61. shot:remove()
  62. break
  63. end
  64. lastP = face.p
  65. wait()
  66. end
  67. shot:remove()
  68. end)
  69. mouse.KeyDown:connect(function(key)
  70. if key == "f" then
  71. shot = Instance.new("Part")
  72. shot.Parent = me2
  73. shot.CanCollide = false
  74. shot.Anchored = true
  75. shot.Size = Vector3.new(2, 2, 2)
  76. shot.Transparency = 0.5
  77. shot.BrickColor = BrickColor.new("Bright red")
  78. local fire = Instance.new("Fire")
  79. fire.Parent = shot
  80. local mesh = Instance.new("SpecialMesh")
  81. mesh.Parent = shot
  82. mesh.MeshType = "Sphere"
  83. local start = CFrame.new(me2.Torso.Position) + Vector3.new(0, 3, 0)
  84. local ending = mouse.Hit.p
  85. local face = CFrame.new(start.p, ending)
  86. shot.CFrame = face
  87. local magn = (start.p - ending).magnitude
  88. local lastP = start.p
  89. for i = 4, 300, 8 do
  90. face = face * CFrame.new(0, 0, -8)
  91. shot.CFrame = face
  92. local mag = (lastP - face.p).magnitude
  93. local t = Instance.new("Part",me2)
  94. t.Anchored = true
  95. t.BrickColor = BrickColor.new("Really red")
  96. t.formFactor = "Custom"
  97. t.Size = Vector3.new(1, 1, 1)
  98. local mm = Instance.new("BlockMesh",t)
  99. mm.Scale = Vector3.new(1, 1, mag)
  100. t.CFrame = CFrame.new(lastP, face.p) * CFrame.new(0, 0, -mag/2)
  101. coroutine.resume(coroutine.create(function()
  102. wait(0.05)
  103. for i = 0, 1, 0.1 do
  104. t.Transparency = i
  105. mm.Scale = Vector3.new(0.4-0.4*i, 0.4-0.4*i, mag)
  106. wait()
  107. end
  108. t:remove()
  109. end))
  110. local hit, pos = RayC(lastP, face.p, 14, me2)
  111. if hit then
  112. local h = hit.Parent:findFirstChild("Humanoid")
  113. if h then
  114. h.Health = h.Health - math.random(15, 35)
  115. end
  116. shot:remove()
  117. break
  118. end
  119. lastP = face.p
  120. wait()
  121. end
  122. shot:remove()
  123. end
  124. end)
  125. end
  126. function onDesel(mouse)
  127. end
  128. bin.Selected:connect(onSelected)
  129. bin.Deselected:connect(onDesel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement