Advertisement
StrawberryMemester

Roblox Medigun Script

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