Advertisement
memberhero

Fixed Medic Script

Jan 6th, 2018
1,175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.11 KB | None | 0 0
  1. --[[Medic Script created by:
  2. Fenrier: Everything.
  3. DarkShadow6: The base of the cloning.
  4. ???: I don't know who made the Medigun model. :\
  5. If you're gonna steal this, then please I ask you. Please don't forum,free model, give
  6. away, or anything like that to this script. Thank you very much :)
  7. Percent done: IDK% [I might add Bonesaw, but I also might not. So... Yea.]
  8. ]]
  9. --Fixed by basstracker1970 below is what needed to be
  10. --Fixed...
  11. local Owner = game:GetService("Players").LocalPlayer
  12. local Me = Owner.Character
  13. script.Parent = Me
  14. local Head = Me.Head
  15. local Torso = Me.Torso
  16. local LeftArm = Me["Left Arm"]
  17. local LeftLeg = Me["Left Leg"]
  18. local RightArm = Me["Right Arm"]
  19. local RightLeg = Me["Right Leg"]
  20. Target = Me
  21. TargetTorso = Torso
  22. pose = "Standing"
  23. animate = true
  24. toolAnim = "None"
  25. toolAnimTime = 0
  26. climbExtra = 0
  27. UBERCHARGE = 0
  28. CHARGEREADY = false
  29. CHARGED = false
  30. maxhealthdebounce = 0
  31. idledebounce = false
  32. healing = false
  33. walking = false
  34. Mode = "Medigun"
  35. chatcon = nil
  36. necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  37. EnterMedic = {"Medic here!", "Los Weiter!", "Raus Raus!", "Horrido!", "Prepare for your examination.", "Hello, Frauleins!"}
  38. WalkingMedic = {"Move! Schnell!", "Mach shnell!", "Los Weiter!", "Forward!", "Good to go!", "Come over here, I promise I will heal you!"}
  39. DamagedMedic = {"Help!", "I require assistance!", "Assistance bitte!"}
  40. ChargeReadyMedic = {"I am fully charged!", "I am charged!", "Ready for ze charge, Herr doctor."}
  41. ChargedMedic = {"Charge me, Herr doctor.", "Now is ze time Herr doctor.", "Oktoberfest!", "I am ze Ubermensh!", "Schnell! Go get zem!", "Now go!", "Yah."}
  42. IdleMedic = {"That was doctor-assisted homicide!", "All I can tell you about this next procedure is that it will be... excruciating!", "Turn your head and cough.", "Achtung! Spy!", "Defend ze point!", "Another successful procedure.", "I healed the man who will kill you", "Hold still, Schweinhunds. This will only sting for a moment."}
  43. ChargedIdleMedic = {"I am ze Ubermensh!", "Oktoberfest!", "Standing near the point does nothing. Get on the point Dummkopfs!", "Haha, what a bloodbath!", "The healing is not as rewarding as the hurting!", "That was doctor-assisted homicide!", "Nein."}
  44.  
  45. --[[function findNearestTorso(pos)
  46. local list = game.Workspace:children()
  47. local torso = nil
  48. local dist = 1000
  49. local temp = nil
  50. local human = nil
  51. local temp2 = nil
  52. for x = 1, #list do
  53. temp2 = list[x]
  54. if (temp2.className == "Model") and (temp2 ~= Character) and (temp2.Name ~= "Rock Thrower") and (temp2.Name ~= "Fenrier") then
  55. temp = temp2:findFirstChild("Torso")
  56. human = temp2:findFirstChild("Humanoid")
  57. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  58. if (temp.Position - pos).magnitude < dist then
  59. torso = temp
  60. dist = (temp.Position - pos).magnitude
  61. end
  62. end
  63. end
  64. end
  65. return torso
  66. end
  67.  
  68. coroutine.resume(coroutine.create(function()
  69. while true do
  70. wait(1)
  71. Target = findNearestTorso(Character.Torso.Position)
  72. TargetTorso = findNearestTorso(Character.Torso.Position)
  73. end
  74. end)) ]]
  75.  
  76. local decoy = Instance.new("Model")
  77. decoy.Parent = workspace
  78. decoy.Name = "Medic"
  79.  
  80. local decoyhead = Head:Clone()
  81. decoyhead.Parent = decoy
  82.  
  83. local decoytorso = Torso:Clone()
  84. decoytorso.Parent = decoy
  85. if decoytorso:findFirstChild("roblox") ~= nil then
  86. decoytorso.roblox.Parent = nil
  87. end
  88.  
  89. local decoyleftarm = LeftArm:Clone()
  90. decoyleftarm.Parent = decoy
  91.  
  92. local decoyrightarm = RightArm:Clone()
  93. decoyrightarm.Parent = decoy
  94.  
  95. local decoyleftleg = LeftLeg:Clone()
  96. decoyleftleg.Parent = decoy
  97.  
  98. local decoyrightleg = RightLeg:Clone()
  99. decoyrightleg.Parent = decoy
  100.  
  101. local hair = Instance.new("Hat")
  102. hair.Name = "BoySceneHair"
  103. local hairpart = Instance.new("Part")
  104. hairpart.Parent = decoy
  105. hairpart.Size = Vector3.new(1,1,2)
  106. hairpart.Name = "Handle"
  107. hairpart.formFactor = 0
  108. hairpart.BottomSurface = 0
  109. hairpart.TopSurface = 0
  110. hairpart.Locked = true
  111. hairpart.Position = decoyhead.Position
  112. local hairweld = Instance.new("Weld")
  113. hairweld.Parent = decoyhead
  114. hairweld.Part1 = decoyhead
  115. hairweld.Part0 = hairpart
  116. hairweld.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  117. local hairmesh = Instance.new("SpecialMesh")
  118. hairmesh.Parent = hairpart
  119. hairmesh.MeshId = "http://www.roblox.com/asset/?id=29880227"
  120. hairmesh.TextureId = "http://www.roblox.com/asset/?id=29880238"
  121. hair.Parent = decoy
  122. hair.AttachmentForward = Vector3.new(0, 0, -1)
  123. hair.AttachmentPos = Vector3.new(0, 0.1, -0.05)
  124. hair.AttachmentRight = Vector3.new(1, 0, 0)
  125. hair.AttachmentUp = Vector3.new(0, 1, 0)
  126.  
  127. local glasses = Instance.new("Hat")
  128. glasses.Name = "bunnyears"
  129. local glassespart = Instance.new("Part")
  130. glassespart.Parent = decoy
  131. glassespart.Size = Vector3.new(2,1,1)
  132. glassespart.Name = "Handle"
  133. glassespart.formFactor = 0
  134. glassespart.BottomSurface = 0
  135. glassespart.TopSurface = 0
  136. glassespart.Locked = true
  137. glassespart.Position = decoyhead.Position
  138. local glassesweld = Instance.new("Weld")
  139. glassesweld.Parent = decoyhead
  140. glassesweld.Part1 = decoyhead
  141. glassesweld.Part0 = glassespart
  142. glassesweld.C1 = CFrame.new(0, 0.2, -0.2, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  143. local glassesmesh = Instance.new("SpecialMesh")
  144. glassesmesh.Parent = glassespart
  145. glassesmesh.MeshId = "http://www.roblox.com/asset/?id=11419729"
  146. glassesmesh.TextureId = "http://www.roblox.com/asset/?id=11419678"
  147. glasses.Parent = decoy
  148. glasses.AttachmentForward = Vector3.new(0, 0, -1)
  149. glasses.AttachmentPos = Vector3.new(0, 0.3, 0.2)
  150. glasses.AttachmentRight = Vector3.new(1, 0, 0)
  151. glasses.AttachmentUp = Vector3.new(0, 1, 0)
  152.  
  153. local decoyhumanoid = Instance.new("Humanoid")
  154. decoyhumanoid.Parent = decoy
  155.  
  156. decoytorso.Position = Torso.Position + Vector3.new(0,5,0)
  157. LeftShoulder = Instance.new("Motor")
  158. LeftShoulder.Parent = decoytorso
  159. LeftShoulder.Part0 = decoytorso
  160. LeftShoulder.Part1 = decoyleftarm
  161. LeftShoulder.MaxVelocity = 0.1
  162. LeftShoulder.C0 = CFrame.new(-decoytorso.Size.x / 2 - decoyleftarm.Size.x / 2, decoyleftarm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  163. LeftShoulder.C1 = CFrame.new(0, decoyleftarm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  164. LeftShoulder.Name = "Left Shoulder"
  165. RightShoulder = Instance.new("Motor")
  166. RightShoulder.Parent = decoytorso
  167. RightShoulder.Part0 = decoytorso
  168. RightShoulder.Part1 = decoyrightarm
  169. RightShoulder.MaxVelocity = 0.1
  170. RightShoulder.C0 = CFrame.new(decoytorso.Size.x / 2 + decoyrightarm.Size.x / 2, decoyrightarm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  171. RightShoulder.C1 = CFrame.new(0, decoyrightarm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  172. RightShoulder.Name = "Right Shoulder"
  173. LeftHip = Instance.new("Motor")
  174. LeftHip.Parent = decoytorso
  175. LeftHip.Part0 = decoytorso
  176. LeftHip.Part1 = decoyleftleg
  177. LeftHip.MaxVelocity = 0.1
  178. LeftHip.C0 = CFrame.new(-decoyleftleg.Size.x / 2, -(decoyleftleg.Size.y / 4) * 3, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  179. LeftHip.C1 = CFrame.new(0, decoyleftleg.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  180. LeftHip.Name = "Left Hip"
  181. RightHip = Instance.new("Motor")
  182. RightHip.Parent = decoytorso
  183. RightHip.Part0 = decoytorso
  184. RightHip.Part1 = decoyrightleg
  185. RightHip.MaxVelocity = 0.1
  186. RightHip.C0 = CFrame.new(decoyrightleg.Size.x / 2, -(decoyrightleg.Size.y / 4) * 3, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  187. RightHip.C1 = CFrame.new(0, decoyrightleg.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  188. RightHip.Name = "Right Hip"
  189. Neck = Instance.new("Weld")
  190. Neck.Name = "Neck"
  191. Neck.Part0 = decoytorso
  192. Neck.Part1 = decoyhead
  193. Neck.C0 = CFrame.new(0, 1.5 * 1, 0)
  194. Neck.C1 = CFrame.new()
  195. Neck.Parent = decoytorso
  196. local GUI = Instance.new("BillboardGui")
  197. GUI.Adornee = decoytorso
  198. GUI.Parent = decoytorso
  199. GUI.Active = true
  200. GUI.Enabled = true
  201. GUI.Size = UDim2.new(1, 0, 1, 0)
  202. GUI.StudsOffset = Vector3.new(0, 4, 0)
  203. local Chat = Instance.new("TextLabel")
  204. Chat.Parent = GUI
  205. Chat.FontSize = "Size12"
  206. Chat.Position = UDim2.new(0.599999964, 0, 0, 0)
  207. Chat.Visible = true
  208. Chat.Text = " "
  209.  
  210. if Me:FindFirstChild("Animate") ~= nil then
  211. local decoyanimate = Me.Animate:Clone()
  212. decoyanimate.Parent = decoy
  213. end
  214.  
  215. local decoyshirt = Instance.new("Shirt")
  216. decoyshirt.Parent = decoy
  217. decoyshirt.ShirtTemplate = "http://www.roblox.com/asset/?id=23869061"
  218. local decoypants = Instance.new("Pants")
  219. decoypants.Parent = decoy
  220. decoypants.PantsTemplate = "http://www.roblox.com/asset/?id=23869182"
  221.  
  222. local medigun = Instance.new("Model")
  223. medigun.Parent = decoy
  224. medigun.Name = "Medigun"
  225. local medipart1 = Instance.new("Part")
  226. medipart1.Parent = medigun
  227. medipart1.BrickColor = BrickColor.new("Medium stone grey")
  228. medipart1.Name = "H1"
  229. medipart1.TopSurface = "Smooth"
  230. medipart1.BottomSurface = "Smooth"
  231. medipart1.Size = Vector3.new(1,1,1)
  232. medipart1.CanCollide = false
  233. medipart1.Position = decoyleftarm.Position
  234. local medipart2 = medipart1:Clone()
  235. medipart2.Parent = medigun
  236. medipart2.Name = "H2"
  237. local medipart3 = medipart1:Clone()
  238. medipart3.Parent = medigun
  239. medipart3.Name = "H3"
  240. local medipart4 = medipart1:Clone()
  241. medipart4.Parent = medigun
  242. medipart4.Name = "H4"
  243. local medipart5 = medipart1:Clone()
  244. medipart5.Parent = medigun
  245. medipart5.Name = "H5"
  246. local medipart6 = medipart1:Clone()
  247. medipart6.Parent = medigun
  248. medipart6.Name = "H6"
  249. local medipart7 = medipart1:Clone()
  250. medipart7.Parent = medigun
  251. medipart7.Name = "H7"
  252. local medipart8 = medipart1:Clone()
  253. medipart8.Parent = medigun
  254. medipart8.Name = "H8"
  255. local medipart9 = medipart1:Clone()
  256. medipart9.Parent = medigun
  257. medipart9.Name = "H9"
  258. local medipart10 = medipart1:Clone()
  259. medipart10.Parent = medigun
  260. medipart10.Name = "H10"
  261. local medipart11 = medipart1:Clone()
  262. medipart11.Parent = medigun
  263. medipart11.Name = "H11"
  264. local medihandle = medipart1:Clone()
  265. medihandle.Parent = medigun
  266. medihandle.Name = "Handle"
  267. medihandle.BrickColor = BrickColor.new("Bright blue")
  268. local beam = Instance.new("Part")
  269. beam.formFactor = 0
  270. beam.Transparency = 0.3
  271. beam.CanCollide = false
  272. beam.Anchored = true
  273. beam.Locked = true
  274. beam.Name = "Beam"
  275. beam.Size = Vector3.new(1,1,1)
  276. local m = Instance.new("SpecialMesh")
  277. m.Parent = beam
  278.  
  279. local medimesh1 = Instance.new("SpecialMesh")
  280. medimesh1.Parent = medipart1
  281. medimesh1.MeshType = "Head"
  282. medimesh1.Scale = Vector3.new(0.75, 1.25, 0.75)
  283. local medimesh2 = Instance.new("SpecialMesh")
  284. medimesh2.Parent = medipart2
  285. medimesh2.MeshType = "Head"
  286. medimesh2.Scale = Vector3.new(0.35, 1.75, 0.35)
  287. local medimesh3 = Instance.new("SpecialMesh")
  288. medimesh3.Parent = medipart3
  289. medimesh3.MeshType = "Head"
  290. medimesh3.Scale = Vector3.new(0.25, 1.5, 0.25)
  291. local medimesh4 = Instance.new("SpecialMesh")
  292. medimesh4.Parent = medipart4
  293. medimesh4.MeshType = "Head"
  294. medimesh4.Scale = Vector3.new(0.25, 1.5, 0.25)
  295. local medimesh5 = Instance.new("SpecialMesh")
  296. medimesh5.Parent = medipart5
  297. medimesh5.MeshType = "Head"
  298. medimesh5.Scale = Vector3.new(0.25, 1.5, 0.25)
  299. local medimesh6 = Instance.new("SpecialMesh")
  300. medimesh6.Parent = medipart6
  301. medimesh6.MeshType = "Head"
  302. medimesh6.Scale = Vector3.new(1.25, 0.75, 1.25)
  303. local medimesh7 = Instance.new("SpecialMesh")
  304. medimesh7.Parent = medipart7
  305. medimesh7.MeshType = "Head"
  306. medimesh7.Scale = Vector3.new(0.85, 1.5, 0.85)
  307. local medimesh8 = Instance.new("SpecialMesh")
  308. medimesh8.Parent = medipart8
  309. medimesh8.MeshType = "Head"
  310. medimesh8.Scale = Vector3.new(1.15, 0.65, 1.15)
  311. local medimesh9 = Instance.new("SpecialMesh")
  312. medimesh9.Parent = medipart9
  313. medimesh9.MeshType = "Brick"
  314. medimesh9.Scale = Vector3.new(0.35, 1, 0.5)
  315. local medimesh10 = Instance.new("SpecialMesh")
  316. medimesh10.Parent = medipart10
  317. medimesh10.MeshType = "Brick"
  318. medimesh10.Scale = Vector3.new(0.35, 0.25, 0.75)
  319. local medimesh11 = Instance.new("SpecialMesh")
  320. medimesh11.Parent = medipart11
  321. medimesh11.MeshType = "Head"
  322. medimesh11.Scale = Vector3.new(0.86, 1.5, 0.86)
  323. local medimesh1 = Instance.new("SpecialMesh")
  324. medimesh1.Parent = medipart1
  325. medimesh1.MeshType = "Head"
  326. medimesh1.Scale = Vector3.new(0.75, 1.25, 0.75)
  327. local hand = medihandle
  328. local h1 = medipart1
  329. local h2 = medipart2
  330. local h3 = medipart3
  331. local h4 = medipart4
  332. local h5 = medipart5
  333. local h6 = medipart6
  334. local h7 = medipart7
  335. local h8 = medipart8
  336. local h9 = medipart9
  337. local h10 = medipart10
  338. local h11 = medipart11
  339. local medipack = Instance.new("Part")
  340. medipack.formFactor = 0
  341. medipack.TopSurface = 0
  342. medipack.BottomSurface = 0
  343. medipack.Size = Vector3.new(2,2,1)
  344. medipack.BrickColor = BrickColor.new(1)
  345. medipack.Name = "Medipack"
  346. medipack.Locked = true
  347. local decal = Instance.new("Decal")
  348. decal.Face = "Back"
  349. decal.Texture = "http://www.roblox.com/asset/?id=5235213"
  350. decal.Parent = medipack
  351. wait()
  352. local w1 = Instance.new("Weld")
  353. w1.Parent = decoyleftarm
  354. w1.Part0 = decoyleftarm
  355. w1.Part1 = h1
  356. w1.C0 = CFrame.new(0,-0.5,-0.5) * CFrame.fromEulerAnglesXYZ(-math.rad(90),0,math.rad(90))
  357. local w = Instance.new("Weld")
  358. w.Parent = decoytorso
  359. w.Part0 = w.Parent
  360. w.Part1 = medipack
  361. w.C0 = CFrame.new(0,0,1)
  362. local w = Instance.new("Weld")
  363. w.Parent = hand
  364. w.Part0 = hand
  365. w.Part1 = h1
  366. w.C0 = CFrame.fromEulerAnglesXYZ(0,0,1.57)
  367. local w = Instance.new("Weld")
  368. w.Parent = hand
  369. w.Part0 = hand
  370. w.Part1 = h2
  371. w.C0 = CFrame.fromEulerAnglesXYZ(0,0,1.57)
  372. local w = Instance.new("Weld")
  373. w.Parent = hand
  374. w.Part0 = hand
  375. w.Part1 = h3
  376. w.C0 = CFrame.new(0.75,0.5,0.5) * CFrame.fromEulerAnglesXYZ(0.8,0,0)
  377. local w = Instance.new("Weld")
  378. w.Parent = hand
  379. w.Part0 = hand
  380. w.Part1 = h4
  381. w.C0 = CFrame.new(-0.75,0.5,0.5) * CFrame.fromEulerAnglesXYZ(0.8,0,0)
  382. local w = Instance.new("Weld")
  383. w.Parent = hand
  384. w.Part0 = hand
  385. w.Part1 = h5
  386. w.C0 = CFrame.new(0,0.95,0.95) * CFrame.fromEulerAnglesXYZ(0,0,1.57)
  387. local w = Instance.new("Weld")
  388. w.Parent = hand
  389. w.Part0 = hand
  390. w.Part1 = h6
  391. w.C0 = CFrame.new(0,0,-0.6) * CFrame.fromEulerAnglesXYZ(1.57,0,0)
  392. local w = Instance.new("Weld")
  393. w.Parent = hand
  394. w.Part0 = hand
  395. w.Part1 = h7
  396. w.C0 = CFrame.new(0,0,-1.5) * CFrame.fromEulerAnglesXYZ(1.57,0,0)
  397. local w = Instance.new("Weld")
  398. w.Parent = hand
  399. w.Part0 = hand
  400. w.Part1 = h8
  401. w.C0 = CFrame.new(0,0,-2) * CFrame.fromEulerAnglesXYZ(1.57,0,0)
  402. local w = Instance.new("Weld")
  403. w.Parent = hand
  404. w.Part0 = hand
  405. w.Part1 = h9
  406. w.C0 = CFrame.new(0,-0.75,-0.45) * CFrame.fromEulerAnglesXYZ(-0.4,0,0)
  407. local w = Instance.new("Weld")
  408. w.Parent = hand
  409. w.Part0 = hand
  410. w.Part1 = h10
  411. w.C0 = CFrame.new(0,-1.35,-0.3) * CFrame.fromEulerAnglesXYZ(-0.4,0,0)
  412. local w = Instance.new("Weld")
  413. w.Parent = hand
  414. w.Part0 = hand
  415. w.Part1 = h11
  416. w.C0 = CFrame.new(0,0,0.5) * CFrame.fromEulerAnglesXYZ(1.57,0,0)
  417. wait()
  418.  
  419. function EnterMedicChat()
  420. if decoyhumanoid.Health ~= 0 then
  421. coroutine.resume(coroutine.create(function()
  422. Chat.Text = EnterMedic[math.random(1,#EnterMedic)]
  423. wait(5)
  424. Chat.Text = " "
  425. end))
  426. end
  427. end
  428.  
  429. function WalkingMedicChat()
  430. if decoyhumanoid.Health ~= 0 then
  431. coroutine.resume(coroutine.create(function()
  432. Chat.Text = WalkingMedic[math.random(1,#WalkingMedic)]
  433. wait(5)
  434. Chat.Text = " "
  435. end))
  436. end
  437. end
  438.  
  439. function DamagedMedicChat()
  440. coroutine.resume(coroutine.create(function()
  441. Chat.Text = DamagedMedic[math.random(1,#DamagedMedic)]
  442. wait(5)
  443. Chat.Text = " "
  444. end))
  445. end
  446.  
  447. function ChargeReadyMedicChat()
  448. if decoyhumanoid.Health ~= 0 then
  449. coroutine.resume(coroutine.create(function()
  450. Chat.Text = ChargeReadyMedic[math.random(1,#ChargeReadyMedic)]
  451. wait(5)
  452. Chat.Text = " "
  453. end))
  454. end
  455. end
  456.  
  457. function ChargedMedicChat()
  458. if decoyhumanoid.Health ~= 0 then
  459. coroutine.resume(coroutine.create(function()
  460. Chat.Text = ChargedMedic[math.random(1,#ChargedMedic)]
  461. wait(5)
  462. Chat.Text = " "
  463. end))
  464. end
  465. end
  466.  
  467. function IdleMedicChat()
  468. if decoyhumanoid.Health ~= 0 then
  469. coroutine.resume(coroutine.create(function()
  470. if CHARGED ~= true then
  471. Chat.Text = IdleMedic[math.random(1,#IdleMedic)]
  472. else
  473. Chat.Text = ChargedIdleMedic[math.random(1,#ChargedIdleMedic)]
  474. end
  475. wait(5)
  476. Chat.Text = " "
  477. end))
  478. end
  479. end
  480.  
  481. EnterMedicChat()
  482.  
  483. function onChatted2(msg, recipient)
  484. if msg == "CHARGE NAO DOKTAR" or msg == "CHARGE ME" then
  485. if CHARGEREADY == true then
  486. ChargedMedicChat()
  487. CHARGED = true
  488. CHARGEREADY = false
  489. UBERCHARGE = 0
  490. local chargeff = Instance.new("ForceField")
  491. chargeff.Parent = Target
  492. local chargeff2 = Instance.new("ForceField")
  493. chargeff2.Parent = decoy
  494. for i = 0,500 do
  495. wait()
  496. if (Torso.Position - medipart8.Position).magnitude <= 30 then
  497. chargeff.Parent = Target
  498. chargeff2.Parent = decoy
  499. else
  500. chargeff.Parent = nil
  501. end
  502. UBERCHARGE = 0
  503. end
  504. CHARGED = false
  505. chargeff.Parent = nil
  506. chargeff2.Parent = nil
  507. end
  508. end
  509. end
  510.  
  511. function onChatted(msg, recipient)
  512. if string.sub(msg, 0, 5) == "heal/" then
  513. for i, v in pairs(game.Players:GetChildren()) do
  514. if v.Character ~= nil then
  515. if string.sub(msg,6) ~= "" and string.lower(string.sub(v.Name, 1, string.len(string.sub(msg, 6)))) == string.lower(string.sub(msg, 6)) then
  516. if v.Character:FindFirstChild("Torso") ~= nil then
  517. Target = v.Character
  518. TargetTorso = v.Character.Torso
  519. if chatcon ~= nil then
  520. chatcon:disconnect()
  521. chatcon=v.Chatted:connect(function(msg, recipient) onChatted2(msg, recipient) end)
  522. end
  523. end
  524. end
  525. end
  526. end
  527. end
  528. --[[if string.find(msg, "heal/") then
  529. c = game.Players:GetChildren()
  530. for blawg = 1, #c do
  531. if string.find(msg, c[blawg].Name) then
  532. Target = c[blawg].Character
  533. TargetTorso = Target.Torso
  534. else
  535. wait()
  536. end
  537. end
  538. end ]]
  539. end
  540.  
  541. chatcon=Owner.Chatted:connect(function(msg, recipient) onChatted2(msg, recipient) end)
  542.  
  543. function move(time)
  544. if animate == false then return end
  545. local amplitude
  546. local frequency
  547. if pose == "Jumping" then
  548. RightShoulder.MaxVelocity = 0.5
  549. LeftShoulder.MaxVelocity = 0.5
  550. RightShoulder.DesiredAngle = 3.14
  551. LeftShoulder.DesiredAngle = -3.14
  552. RightHip.DesiredAngle = 0
  553. LeftHip.DesiredAngle = 0
  554. return
  555. end
  556. if pose == "FreeFall" then
  557. RightShoulder.MaxVelocity = 0.5
  558. LeftShoulder.MaxVelocity = 0.5
  559. RightShoulder.DesiredAngle = 3.14
  560. LeftShoulder.DesiredAngle = -3.14
  561. RightHip.DesiredAngle = 0
  562. LeftHip.DesiredAngle = 0
  563. return
  564. end
  565. if pose == "Seated" then
  566. RightShoulder.MaxVelocity = 0.15
  567. LeftShoulder.MaxVelocity = 0.15
  568. RightShoulder.DesiredAngle = 3.14 / 2
  569. LeftShoulder.DesiredAngle = -3.14 / 2
  570. RightHip.DesiredAngle = 3.14 / 2
  571. LeftHip.DesiredAngle = -3.14 / 2
  572. return
  573. end
  574. if pose == "Running" then
  575. RightShoulder.MaxVelocity = 0.15
  576. LeftShoulder.MaxVelocity = 0.15
  577. amplitude = 1
  578. frequency = 9
  579. elseif pose == "climbExtra" then
  580. RightShoulder.MaxVelocity = 0.5
  581. LeftShoulder.MaxVelocity = 0.5
  582. amplitude = 1
  583. frequency = 9
  584. climbExtra = 3.14
  585. else
  586. amplitude = 0.1
  587. frequency = 1
  588. end
  589. desiredAngle = amplitude * math.sin(time * frequency)
  590. RightShoulder.DesiredAngle = desiredAngle + climbExtra
  591. LeftShoulder.DesiredAngle = desiredAngle - climbExtra
  592. RightHip.DesiredAngle = -desiredAngle
  593. LeftHip.DesiredAngle = -desiredAngle
  594. for _, Children in ipairs(decoy:GetChildren()) do
  595. if Children.className == "Tool" then
  596. local tool = Children
  597. end
  598. end
  599. if tool then
  600. for _, Children in ipairs(decoy:GetChildren()) do
  601. if Children.Name == "toolanim" and Children.className == "StringValue" then
  602. local animStringValueObject = Children
  603. end
  604. end
  605. if animStringValueObject then
  606. toolAnim = animStringValueObject.Value
  607. animStringValueObject.Parent = nil
  608. elseif time > toolAnimTime then
  609. toolAnimTime = 0
  610. end
  611. if toolAnim == "None" then
  612. RightShoulder.DesiredAngle = 1.57
  613. elseif toolAnim == "Slash" then
  614. RightShoulder.MaxVelocity = 0.5
  615. RightShoulder.DesiredAngle = 0
  616. elseif toolAnim == "Lunge" then
  617. RightShoulder.MaxVelocity = 0.5
  618. LeftShoulder.MaxVelocity = 0.5
  619. RightHip.MaxVelocity = 0.5
  620. LeftHip.MaxVelocity = 0.5
  621. RightShoulder.DesiredAngle = 1.57
  622. LeftShoulder.DesiredAngle = 1.0
  623. RightHip.DesiredAngle = 1.57
  624. LeftHip.DesiredAngle = 1.0
  625. end
  626. else
  627. toolAnim = "None"
  628. toolAnimTime = 0
  629. end
  630. end
  631. decoyhumanoid.Died:connect(function() pose = "Dead" wait(5.5) if decoy == nil then return end decoy:Remove() end)
  632. decoyhumanoid.Running:connect(function(speed) if speed > 0 then pose = "Running" else pose = "Standing" end end)
  633. decoyhumanoid.Jumping:connect(function() pose = "Jumping" end)
  634. decoyhumanoid.Climbing:connect(function() pose = "climbExtra" end)
  635. decoyhumanoid.GettingUp:connect(function() pose = "GettingUp" end)
  636. decoyhumanoid.FreeFalling:connect(function() pose = "FreeFall" end)
  637. decoyhumanoid.FallingDown:connect(function() pose = "FallingDown" end)
  638. decoyhumanoid.Seated:connect(function() pose = "Seated" end)
  639. decoyhumanoid.PlatformStanding:connect(function() pose = "PlatformStanding" end)
  640. Owner.Chatted:connect(function(msg, recipient) onChatted(msg, recipient) end)
  641.  
  642. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  643. RightShoulder.Parent = nil
  644. LeftShoulder.Parent = nil
  645. RW.Part0 = decoytorso
  646. RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  647. RW.C1 = CFrame.new(0, 0.5, 0)
  648. RW.Part1 = decoyrightarm
  649. RW.Parent = decoytorso
  650. _G.R = RW
  651. LW.Part0 = decoytorso
  652. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  653. LW.C1 = CFrame.new(0, 0.5, 0)
  654. LW.Part1 = decoyleftarm
  655. LW.Parent = decoytorso
  656. _G.L = LW
  657. wait(1)
  658. for i = 0,1,0.1 do
  659. wait()
  660. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i,0,0)
  661. RW.C1 = CFrame.new(0, 0.5, 0)
  662. LW.C0 = CFrame.new(-1.5+1.6*i, 0.5-0.3*i, -1*i) * CFrame.fromEulerAnglesXYZ(1*i,0,0)
  663. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0,0,-0.8*i)
  664. w1.C0 = CFrame.new(0.7*i,-0.5,-0.5+0.1*i) * CFrame.fromEulerAnglesXYZ(-math.rad(90)+0.75*i,0.75*i,math.rad(90)-0.5*i)
  665. end
  666. wait(1)
  667. local b = Instance.new("BodyGyro")
  668. b.P=18000
  669. b.D=600
  670. b.maxTorque=Vector3.new(80000,80000000,80000)*50000000000000000000000000
  671. b.Parent = decoyhead
  672. coroutine.resume(coroutine.create(function()
  673. lhh = decoyhumanoid.Health
  674. while true do
  675. wait()
  676. if decoyhumanoid.Health < lhh then
  677. DamagedMedicChat()
  678. lhh = decoyhumanoid.Health
  679. end
  680. decoyhumanoid.PlatformStand = false
  681. decoyhumanoid.Sit = false
  682. if healing ~= true and Mode == "Medigun" then
  683. WalkingMedicChat()
  684. decoyhumanoid:MoveTo(TargetTorso.Position + Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30)), TargetTorso)
  685. wait(3)
  686. else
  687. for i = 0,100 do
  688. if healing == true and idledebounce == false then
  689. wait()
  690. end
  691. if healing == true then
  692. coroutine.resume(coroutine.create(function()
  693. if idledebounce == false then
  694. idledebounce = true
  695. IdleMedicChat()
  696. wait(10)
  697. idledebounce = false
  698. end
  699. end))
  700. end
  701. end
  702. end
  703. end
  704. end))
  705. coroutine.resume(coroutine.create(function()
  706. while true do
  707. for i = 0,5 do
  708. wait(0.1)
  709. beam.Reflectance = beam.Reflectance + 0.2
  710. m.Scale = m.Scale + Vector3.new(0.1,0,0.1)
  711. end
  712. for i = 0,5 do
  713. wait(0.1)
  714. beam.Reflectance = beam.Reflectance - 0.2
  715. m.Scale = m.Scale - Vector3.new(0.1,0,0.1)
  716. end
  717. end
  718. end))
  719. while true do
  720. wait(0)
  721. move(game:GetService("Workspace").DistributedGameTime)
  722. if (TargetTorso.Position - medipart8.Position).magnitude <= 30 then
  723. healing = true
  724. beam.BrickColor = TargetTorso.BrickColor
  725. beam.Parent = decoy
  726. beam.CFrame = CFrame.new((TargetTorso.Position + medipart8.Position) / 2, TargetTorso.Position) * CFrame.fromEulerAnglesXYZ(1.57,0,0)
  727. m.Scale = (m.Scale - Vector3.new(0,m.Scale.y,0)) + Vector3.new(0,1,0)
  728. m.Scale = m.Scale + Vector3.new(0,(TargetTorso.Position - medipart8.Position).magnitude - 1,0)
  729. Target.Humanoid.Health = Target.Humanoid.Health + 0.3
  730. decoyhumanoid.Health = decoyhumanoid.Health + 0.1
  731. --[[offset=(decoytorso.Position.y-TargetTorso.Position.y)/60
  732. mag=(decoytorso.Position-TargetTorso.Position).magnitude/80
  733. offset=offset/mag
  734. decoytorso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(offset,0,0)
  735. RW.C0 = CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(1.2+0.37-offset,0,0)
  736. LW.C0 = CFrame.new(-1.5+1.5,0.5,-1.4) * CFrame.fromEulerAnglesXYZ(1.7,-offset,0.9)
  737. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7-offset,0,0)
  738. RW.C1 = CFrame.new(0, 0.5, 0)
  739. LW.C0 = CFrame.new(-1.5+1.6, 0.5-0.3, -1) * CFrame.fromEulerAnglesXYZ(1,-offset,0)
  740. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0,0,-0.8) ]]
  741. if UBERCHARGE <= 1000 then
  742. --if UBERCHARGE <= 50 then
  743. UBERCHARGE = UBERCHARGE + 1
  744. elseif CHARGEREADY == false then
  745. ChargeReadyMedicChat()
  746. CHARGEREADY = true
  747. local s = Instance.new("Sparkles")
  748. s.Parent = medipart8
  749. coroutine.resume(coroutine.create(function()
  750. wait(5)
  751. s.Parent = nil
  752. end))
  753. end
  754. else
  755. healing = false
  756. beam.Parent = nil
  757. end
  758. local dir = (TargetTorso.Position - decoytorso.Position).unit
  759. local spawnpos = decoytorso.Position
  760. local pos = spawnpos + (dir * 1)
  761. b.cframe = CFrame.new(pos, pos + dir)
  762. if Target.Parent == nil and Target == Me then
  763. decoy:BreakJoints()
  764. end
  765. if Target:findFirstChild("Humanoid") ~= nil then
  766. if Target.Humanoid.Health == 0 and Target == Me then
  767. decoy:BreakJoints()
  768. end
  769. else
  770. Target = Me
  771. TargetTorso = Torso
  772. end
  773. end
  774. -- lego This acts as a chat filter. Don't ask why I do it. I just do >.>
  775. --[[
  776. Copyrighted (C) Fenrier 2011
  777. This script is copyrighted for Fenrier. Any use of this script is breaking
  778. this copyright.
  779. All Rights Reserved.
  780. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement