Advertisement
Gametoy

heal

Feb 25th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. local pjts = {}
  2.  
  3. local swagbullets = 1e300
  4.  
  5. local mediplus = Instance.new("BillboardGui")
  6. mediplus.Size = UDim2.new(1,0,1,0)
  7. do
  8. --[[local frame = Instance.new("Frame",mediplus)
  9. frame.BorderSizePixel = -1
  10. frame.BackgroundColor3 = Color3.new(1,1,1)
  11. frame.Size = UDim2.new(0.4,4,1,4)
  12. frame.Position = UDim2.new(0.3,-2,0,-2)
  13. local frame = Instance.new("Frame",mediplus)
  14. frame.BorderSizePixel = -1
  15. frame.BackgroundColor3 = Color3.new(1,1,1)
  16. frame.Size = UDim2.new(1,4,0.4,4)
  17. frame.Position = UDim2.new(0,-2,0.3,-2)]]
  18. local frame = Instance.new("Frame",mediplus)
  19. frame.BorderSizePixel = -1
  20. frame.BackgroundColor3 = Color3.new(1,1,1)
  21. frame.Size = UDim2.new(0.6,0,1.2,0)
  22. frame.Position = UDim2.new(0.2,0,-0.1,0)
  23. local frame = Instance.new("Frame",mediplus)
  24. frame.BorderSizePixel = -1
  25. frame.BackgroundColor3 = Color3.new(1,1,1)
  26. frame.Size = UDim2.new(1.2,0,0.6,0)
  27. frame.Position = UDim2.new(-0.1,0,0.2,0)
  28. local frame = Instance.new("Frame",mediplus)
  29. frame.BorderSizePixel = -1
  30. frame.BackgroundColor3 = Color3.new(0,0,1)
  31. frame.Size = UDim2.new(0.4,0,1,0)
  32. frame.Position = UDim2.new(0.3,0,0,0)
  33. local frame = Instance.new("Frame",mediplus)
  34. frame.BorderSizePixel = -1
  35. frame.BackgroundColor3 = Color3.new(0,0,1)
  36. frame.Size = UDim2.new(1,0,0.4,0)
  37. frame.Position = UDim2.new(0,0,0.3,0)
  38. end
  39.  
  40. local player = game:GetService("Players").LocalPlayer
  41. local mouse = player:GetMouse()
  42. local mousedown = false
  43. local downtime = 0
  44. local selected = false
  45. local neck = player.Character.Torso.Neck
  46. local neckc0 = neck.C0
  47.  
  48. local bin = Instance.new("HopperBin", player.Backpack)
  49. bin.Name = "Mediface"
  50.  
  51. local bang = Instance.new("Sound", player.Character.Head)
  52. bang.SoundId = "http://roblox.com/asset/?id=260421433"
  53.  
  54. function gethums(part)
  55. local hums = {}
  56. local function scanparent(asd)
  57. local humscan = {}
  58. for _,v in pairs(asd.Parent:GetChildren()) do
  59. if v:IsA("Humanoid") then
  60. table.insert(humscan,v)
  61. end
  62. end
  63. return asd.Parent, humscan
  64. end
  65. local currentasd = part
  66. while true do
  67. if currentasd.Parent ~= workspace then
  68. local parent, humscan = scanparent(currentasd)
  69. hums = {unpack(hums),unpack(humscan)}
  70. currentasd = parent
  71. else
  72. break
  73. end
  74. end
  75. return hums
  76. end
  77.  
  78. bin.Selected:connect(function()
  79. selected = true
  80. end)
  81. bin.Deselected:connect(function()
  82. selected = false
  83. mousedown = false
  84. end)
  85.  
  86. mouse.Button1Down:connect(function()
  87. if selected then
  88. mousedown = true
  89. bang:Play()
  90. end
  91. end)
  92. mouse.Button1Up:connect(function()
  93. if selected then
  94. mousedown = false
  95. end
  96. end)
  97.  
  98. --FireProjectile(player.Character.Head.Position, player.Character.Head.Velocity+mouse.UnitRay.Direction*400, function(self,...) return false end, {player.Character})
  99.  
  100. while true do
  101. local dt = wait()
  102. local ax,ay,az = player.Character.Torso.CFrame:toEulerAnglesXYZ()
  103. local cx,cy,cz = CFrame.new(Vector3.new(),mouse.UnitRay.Direction):toEulerAnglesXYZ()
  104. neck.C0 = CFrame.new(0,1,0)*(CFrame.Angles(ax,ay,az):inverse())*CFrame.Angles(cx,cy,cz)*CFrame.Angles(-math.pi/2,0,math.pi)
  105. if mousedown then
  106. downtime = downtime + dt
  107. else
  108. downtime = 0
  109. end
  110. if downtime >= 0.03 then
  111. for i = 0.03, downtime, 0.03 do
  112. if swagbullets > 0 then
  113. downtime = downtime - 0.03
  114. swagbullets = swagbullets - 1
  115. local medi = Instance.new("Part")
  116. medi.Anchored = false
  117. medi.CanCollide = false
  118. medi.TopSurface = 0
  119. medi.BottomSurface = 0
  120. medi.FormFactor = "Custom"
  121. medi.Size = Vector3.new(1,1,1)
  122. medi.Transparency = 1
  123. medi.CFrame = player.Character.Head.CFrame
  124. local medilight = Instance.new("PointLight",medi)
  125. medilight.Color = Color3.new(0,0,1)
  126. local plus = mediplus:clone()
  127. plus.Parent = medi
  128. plus.Adornee = medi
  129. local bv = Instance.new("BodyVelocity",medi)
  130. bv.velocity = player.Character.Head.Velocity+((Vector3.new(math.random()-0.5,math.random()-0.5,math.random()-0.5)*0.4)+mouse.UnitRay.Direction)*30
  131. medi.Parent = workspace
  132. local shrinking = false
  133. table.insert(pjts,medi)
  134. medi.Touched:connect(function(op)
  135. local opismedi = false
  136. for _,v in pairs(pjts) do
  137. if op == v then
  138. opismedi = true
  139. break
  140. end
  141. end
  142. if not op:IsDescendantOf(player.Character) and not opismedi and not shrinking then
  143. local size = 1
  144. shrinking = true
  145. bv:Destroy()
  146. medi.Anchored = true
  147. while true do
  148. local dt = wait()
  149. size = size - dt*2
  150. plus.Size = UDim2.new(size,0,size,0)
  151. if op:IsDescendantOf(workspace) then
  152. local hums = gethums(op)
  153. for _,hum in pairs(hums) do
  154. hum:TakeDamage(-dt*100)
  155. end
  156. end
  157. if size <= 0 then
  158. break
  159. end
  160. end
  161. medi:Destroy()
  162. end
  163. end)
  164. coroutine.wrap(function()
  165. wait(1)
  166. if not shrinking then
  167. shrinking = true
  168. local size = 1
  169. while true do
  170. size = size - wait()*2
  171. plus.Size = UDim2.new(size,0,size,0)
  172. if size <= 0 then
  173. break
  174. end
  175. end
  176. medi:Destroy()
  177. end
  178. end)()
  179. else
  180. if not clicking.IsPlaying then
  181. clicking:Play()
  182. bang:Stop()
  183. end
  184. end
  185. end
  186. end
  187. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement