Advertisement
TheUnknownDiscord

medic

Jun 8th, 2022
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.81 KB | None | 0 0
  1. local sound = Instance.new("Sound")
  2. sound.PlayOnRemove = true
  3. local part = Instance.new("Part",owner.Character)
  4. local msh = Instance.new("SpecialMesh", part)
  5. msh.MeshId = "rbxassetid://9032989020"
  6. msh.TextureId = "rbxassetid://9032989352"
  7. msh.Scale = Vector3.new(0.125,0.125,0.125)
  8. part.CanCollide = false
  9. owner.Character.Humanoid.WalkSpeed = 14
  10. local s = Instance.new("Sound",owner.Character.Head)
  11. s.Volume = 1
  12. s.SoundId = "rbxassetid://8238598284"
  13. s.Looped = true
  14. NLS([[
  15. s = script.Parent.Head:FindFirstChildWhichIsA("Sound")
  16. mouse = owner:GetMouse()
  17. mouse.KeyDown:Connect(function(key)
  18. key = key:lower()
  19. if key:byte() == 48 then
  20. for i = 1,14 do
  21. task.wait()
  22. owner.Character.Humanoid.WalkSpeed = math.clamp(owner.Character.Humanoid.WalkSpeed + 1,14,28)
  23. s.Pitch = math.clamp(s.Pitch + 0.07142857142,1,2)
  24. end
  25. end
  26. end)
  27. mouse.KeyUp:Connect(function(key)
  28. key = key:lower()
  29. if key:byte() == 48 then
  30. for i = 1,14 do
  31. task.wait()
  32. owner.Character.Humanoid.WalkSpeed = math.clamp(owner.Character.Humanoid.WalkSpeed - 1,14,28)
  33. s.Pitch = math.clamp(s.Pitch - 0.07142857142,1,2)
  34. end
  35. end
  36. end)
  37. local db = false
  38. game:GetService("RunService").RenderStepped:Connect(function()
  39. if owner.Character.Humanoid.MoveDirection ~= Vector3.new(0,0,0) and owner.Character.Humanoid.FloorMaterial ~= Enum.Material.Air then
  40. if not db then
  41. db = true
  42. s:Resume()
  43. end
  44. else
  45. s:Pause()
  46. db = false
  47. end
  48. end)
  49. ]],owner.Character)
  50. part.Size = Vector3.new(1.82233333333, 2.06408333333, 0.68208333333)
  51. part.Massless = true
  52. local w = Instance.new("Weld", owner.Character)
  53. w.Part0 = part
  54. w.Part1 = owner.Character.Torso
  55. w.C1 = CFrame.new(0, 0, 1)
  56. sound.Volume = 1
  57. sound.SoundId = "rbxassetid://4458750270"
  58. local heal = "rbxassetid://7380846790"
  59. local equip = "rbxassetid://4458750270"
  60. tool = Instance.new("Tool",owner.Backpack)
  61. tool.Grip = CFrame.new(0.125,0.75,1.75) * CFrame.Angles(math.rad(11),math.rad(10),math.rad(-21)) * CFrame.Angles(math.rad(-14),0,0)
  62. tool.Name = "Medigun"
  63. local medigun = Instance.new("Part", tool)
  64. medigun.Name = "Handle"
  65. medigun.Size = Vector3.new(1.2815, 1.9999, 3.5064)
  66. local medigun2 = Instance.new("Part", owner.Character)
  67. medigun2.CanCollide = false
  68. medigun2.Massless = true
  69. medigun2.Size = Vector3.new(1.2815, 1.9999, 3.5064)
  70. local w2 = Instance.new("Weld", owner.Character)
  71. w2.Part0 = medigun2
  72. w2.Part1 = owner.Character.Torso
  73. w2.C1 = CFrame.new(1.25, 0, 0.8) * CFrame.Angles(math.rad(-11),math.rad(-10),math.rad(-7)) * CFrame.Angles(math.rad(90),0,0)
  74. w2.C0 = CFrame.Angles(math.rad(18),math.rad(-5),math.rad(90))
  75. local msh = Instance.new("SpecialMesh", medigun2)
  76. msh.MeshId = "rbxassetid://9029971538"
  77. msh.TextureId = "rbxassetid://9021800315"
  78. msh.Scale = Vector3.new(0.125, 0.125, 0.125)
  79. local attachment0 = Instance.new("Attachment",medigun)
  80. local attachment1 = Instance.new("Attachment",part)
  81. local alignposition = Instance.new("RopeConstraint",part)
  82. alignposition.Attachment0 = attachment0
  83. alignposition.Attachment1 = attachment1
  84. alignposition.Visible = true
  85. alignposition.Length = 3
  86. alignposition.Thickness = 0.35
  87. alignposition.Restitution = 0
  88. alignposition.Color = BrickColor.new("Black")
  89. attachment0.CFrame = CFrame.new(0.05,0,2)
  90. attachment1.CFrame = CFrame.new(0.65,-0.75,0.125)
  91. local attachment0 = Instance.new("Attachment",medigun2)
  92. local attachment1 = Instance.new("Attachment",part)
  93. local alignposition = Instance.new("RopeConstraint",part)
  94. alignposition.Attachment0 = attachment0
  95. alignposition.Attachment1 = attachment1
  96. alignposition.Visible = true
  97. alignposition.Length = 3
  98. alignposition.Thickness = 0.35
  99. alignposition.Restitution = 0
  100. alignposition.Color = BrickColor.new("Black")
  101. attachment0.CFrame = CFrame.new(0.05,-0.125,2)
  102. attachment1.CFrame = CFrame.new(0.65,-0.65,0.125)
  103. local muzzle = Instance.new("Part",medigun)
  104. muzzle.Transparency = 1
  105. muzzle.CanCollide = false
  106. muzzle.Size = Vector3.new(0.1,0.1,0.1)
  107. local wel = Instance.new("Weld",medigun)
  108. wel.Part0 = muzzle
  109. wel.Part1 = medigun
  110. wel.C0 = CFrame.Angles(math.rad(-11),math.rad(-10),math.rad(21)) * CFrame.new(0.3,-0.725,2)
  111. local msh = Instance.new("SpecialMesh", medigun)
  112. msh.MeshId = "rbxassetid://9029971538"
  113. msh.TextureId = "rbxassetid://9021800315"
  114. msh.Scale = Vector3.new(0.125, 0.125, 0.125)
  115. local weld = Instance.new("Weld",owner.Character.Torso)
  116. weld.Part0 = owner.Character["Right Arm"]
  117. weld.Part1 = owner.Character.Torso
  118. weld.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
  119. local weld2 = Instance.new("Weld",owner.Character.Torso)
  120. weld2.Part0 = owner.Character["Left Arm"]
  121. weld2.Part1 = owner.Character.Torso
  122. weld2.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
  123. weld2.Enabled = false
  124. weld.Enabled = false
  125. local tweenfinished = false
  126. local tweenService = game:GetService("TweenService")
  127. local tweenInfo = TweenInfo.new(0.5,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
  128. local tweenInfo2 = TweenInfo.new(0.65,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
  129. local goal = {}
  130. goal.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
  131. local tween = tweenService:Create(weld2, tweenInfo, goal)
  132. local goal2 = {}
  133. goal2.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
  134. local tween2 = tweenService:Create(weld, tweenInfo2, goal2)
  135. tool.AncestryChanged:Connect(function(_, who)
  136. if who == owner.Character then
  137. alignposition.Visible = false
  138. medigun2.Transparency = 1
  139. medigun.Transparency = 0
  140. weld.Enabled = true
  141. weld2.Enabled = true
  142. sound.Volume = 0.5
  143. sound.SoundId = equip
  144. sound.Parent = medigun
  145. sound.Parent = nil
  146. tween:Play()
  147. tween2:Play()
  148. tween2.Completed:Wait()
  149. tweenfinished = true
  150. else
  151. medigun.Transparency = 1
  152. alignposition.Visible = true
  153. medigun2.Transparency = 0
  154. weld.Enabled = false
  155. weld2.Enabled = false
  156. weld.C1 = CFrame.new(1.5,-0.75,-0.25) * CFrame.Angles(math.rad(186),math.rad(-10),math.rad(-25))
  157. weld2.C1 = CFrame.new(-0.125,0.5,0) * CFrame.Angles(math.rad(150),math.rad(20),math.rad(40))
  158. tween2:Cancel()
  159. tween:Cancel()
  160. tweenfinished = false
  161. end
  162. end)
  163. local attachment0 = Instance.new("Attachment")
  164. attachment0.Parent = muzzle
  165. local attachment1 = Instance.new("Attachment")
  166. attachment1.Parent = medigun
  167. local beam = Instance.new("Beam",medigun)
  168. beam.Attachment0 = attachment0
  169. beam.Attachment1 = attachment1
  170. beam.CurveSize0 = 0.5
  171. beam.CurveSize1 = 1.5
  172. beam.FaceCamera = true
  173. beam.Segments = 10
  174. beam.Width0 = 1
  175. beam.Width1 = 0.75
  176. beam.Texture = "rbxassetid://175588117"
  177. beam.TextureLength = 1
  178. beam.LightEmission = 1
  179. beam.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0.125),NumberSequenceKeypoint.new(1, 0.5)}
  180. beam.Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(227, 34, 34)),ColorSequenceKeypoint.new(1, Color3.fromRGB(250, 30, 30))}
  181. beam.Enabled = false
  182. local active = false
  183. local pe = Instance.new("ParticleEmitter",muzzle)
  184. pe.Color = ColorSequence.new(Color3.fromRGB(255, 74, 29))
  185. pe.LightEmission = 0.75
  186. pe.Size = NumberSequence.new{NumberSequenceKeypoint.new(0,1.25),NumberSequenceKeypoint.new(0.5,1),NumberSequenceKeypoint.new(1,0.7)}
  187. pe.Texture = "rbxassetid://9345352897"
  188. pe.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0,0.4),NumberSequenceKeypoint.new(0.5,0.25),NumberSequenceKeypoint.new(1,1)}
  189. pe.Lifetime = NumberRange.new(0.4,0.7)
  190. pe.Rate = 50
  191. pe.LockedToPart = true
  192. pe.Rotation = NumberRange.new(0,360)
  193. pe.RotSpeed = NumberRange.new(1000)
  194. pe.Speed = NumberRange.new(1.5,3)
  195. pe.EmissionDirection = "Front"
  196. pe.Enabled = false
  197. local model = nil
  198. local function findNearestTorso(pos)
  199. local list = game.Workspace:GetChildren()
  200. local torso = nil
  201. local dist = 20
  202. local temp = nil
  203. local human = nil
  204. local temp2 = nil
  205. local LastAngle = 80
  206. for x = 1, #list do
  207. temp2 = list[x]
  208. if (temp2.className == "Model") and (temp2 ~= model) and temp2 ~= owner.Character then
  209. temp = temp2:findFirstChild("Head")
  210. human = temp2:findFirstChild("Humanoid")
  211. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  212. local Angle = math.deg(math.acos(owner.Character.Head.CFrame.lookVector:Dot((temp.Position - pos).Unit)))
  213. if Angle <= LastAngle then
  214. if (temp.Position - pos).magnitude < dist then
  215. torso = temp
  216. dist = (temp.Position - pos).magnitude
  217. LastAngle = Angle
  218. end
  219. end
  220. end
  221. end
  222. end
  223. return torso
  224. end
  225. local whoheal = nil
  226. tool.Activated:Connect(function()
  227. if tweenfinished then
  228. local torso = findNearestTorso(medigun.Position)
  229. if torso~=nil then
  230. active = true
  231. whoheal = torso:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid")
  232. pe.Enabled = true
  233. beam.Enabled = true
  234. attachment1.Parent = torso
  235. sound.Volume = 0.5
  236. sound.SoundId = heal
  237. sound.Parent = medigun
  238. sound.Parent = nil
  239. end
  240. end
  241. end)
  242. tool.Deactivated:Connect(function()
  243. active = false
  244. pe.Enabled = false
  245. beam.Enabled = false
  246. attachment1.Parent = medigun
  247. whoheal = nil
  248. end)
  249. function whatpitch(letter)
  250. if letter == "a" then return 1.2 end
  251. if letter == "b" then return 0.9 end
  252. if letter == "c" then return 1 end
  253. if letter == "d" then return 0.8 end
  254. if letter == "e" then return 1.1 end
  255. if letter == "f" then return 0.9 end
  256. if letter == "g" then return 1 end
  257. if letter == "h" then return 0.9 end
  258. if letter == "i" then return 1.2 end
  259. if letter == "j" then return 1 end
  260. if letter == "k" then return 1.3 end
  261. if letter == "l" then return 1 end
  262. if letter == "m" then return 0.8 end
  263. if letter == "n" then return 0.7 end
  264. if letter == "o" then return 0.8 end
  265. if letter == "p" then return 1 end
  266. if letter == "q" then return 1.2 end
  267. if letter == "r" then return 0.9 end
  268. if letter == "s" then return 1 end
  269. if letter == "t" then return 1.2 end
  270. if letter == "u" then return 1 end
  271. if letter == "v" then return 0.9 end
  272. if letter == "w" then return 1 end
  273. if letter == "x" then return 0.8 end
  274. if letter == "y" then return 0.9 end
  275. if letter == "z" then return 1.1 end
  276. end
  277. clik = Instance.new("Sound")
  278. clik.Volume = 1
  279. clik.SoundId = "rbxassetid://7903113688"
  280. clik.PlayOnRemove = true
  281. owner.Chatted:Connect(function(msg)
  282. if msg:sub(1,3) ~= "/e " then
  283. local billboard = Instance.new("BillboardGui", owner.Character.Head)
  284. billboard.Adornee = owner.Character.Head
  285. billboard.Size = UDim2.new(3,0,1.5,0)
  286. billboard.StudsOffset = Vector3.new(-3, 2.5, 0)
  287. local tb = Instance.new("TextBox", billboard)
  288. tb.BackgroundTransparency = 1
  289. tb.TextStrokeTransparency = 0
  290. tb.TextColor3 = Color3.new(209/255, 42/255, 42/255)
  291. tb.TextSize = 25
  292. tb.Font = "PatrickHand"
  293. tb.MultiLine = true
  294. tb.Text = " "
  295. tb.TextWrapped = true
  296. tb.TextScaled = true
  297. tb.Size = billboard.Size
  298. for i = 1, #msg do
  299. tb.Text = string.sub(msg,1,i)
  300. if msg:sub(i,i) ~= " " then
  301. if (msg:sub(i,i) == msg:sub(i,i):lower()) then
  302. local p = whatpitch(msg:sub(i,i))
  303. clik.Pitch = p
  304. else
  305. local p = whatpitch(msg:sub(i,i))
  306. pcall(function()
  307. clik.Pitch = (p - 0.2)
  308. end)
  309. end
  310. wait(0.125)
  311. clik.Parent = owner.Character.Head
  312. clik.Parent = nil
  313. end
  314. end
  315. tb.Text = msg
  316. game:GetService("Debris"):AddItem(billboard,5)
  317. end
  318. end)
  319. local hitrecent = false
  320. local lasthealth = owner.Character.Humanoid.Health
  321. owner.Character.Humanoid.HealthChanged:Connect(function(new)
  322. if new < lasthealth then
  323. hitrecent = true
  324. local recenthealth = new
  325. delay(2,function()
  326. if recenthealth <= lasthealth then
  327. print("good")
  328. hitrecent = false
  329. end
  330. end)
  331. lasthealth = new
  332. end
  333. end)
  334. while task.wait() do
  335. if active and tweenfinished then
  336. local rand = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
  337. local rand2 = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
  338. local rand3 = (Random.new():NextNumber(-0.01875,0.01875)*math.sin(45*tick()))
  339. weld2.C1 = CFrame.new(-0.125 + rand,-0.5 + rand2,-2 + rand3) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40)) * CFrame.Angles(math.rad(rand2 * 3),math.rad(rand * 3),math.rad(rand3 * 3))
  340. weld.C1 = CFrame.new(1.5 + rand,0.75 + rand2,-0.25 + rand3) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25)) * CFrame.Angles(math.rad(rand2 * 3),math.rad(rand * 3),math.rad(rand3 * 3))
  341. wait(0.025)
  342. elseif not active and tweenfinished then
  343. weld.C1 = CFrame.new(1.5,0.75,-0.25) * CFrame.Angles(math.rad(76),math.rad(-10),math.rad(-25))
  344. weld2.C1 = CFrame.new(-0.125,-0.5,-2) * CFrame.Angles(math.rad(40),math.rad(20),math.rad(40))
  345. end
  346. if whoheal ~= nil and (medigun.Position - whoheal.Parent:FindFirstChildWhichIsA("Part").Position).Magnitude <= 35 then
  347. whoheal.Health += 0.85
  348. elseif whoheal ~= nil and (medigun.Position - whoheal.Parent:FindFirstChildWhichIsA("Part").Position).Magnitude > 35 then
  349. whoheal = nil
  350. pe.Enabled = false
  351. beam.Enabled = false
  352. active = false
  353. end
  354. if not hitrecent then
  355. owner.Character.Humanoid.Health += 0.25
  356. end
  357. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement