Advertisement
BNutty07

TWITCH

Nov 4th, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.75 KB | None | 0 0
  1. --Created with PenguinAnonymous's compiler
  2. --PenguinAnonymous is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors: Camera
  11. local runDummyScript = function(f,scri)
  12. local oldenv = getfenv(f)
  13. local newenv = setmetatable({}, {
  14. __index = function(_, k)
  15. if k:lower() == 'script' then
  16. return scri
  17. else
  18. return oldenv[k]
  19. end
  20. end
  21. })
  22. setfenv(f, newenv)
  23. ypcall(function() f() end)
  24. end
  25. cors = {}
  26. mas = Instance.new("Model",game:GetService("Lighting"))
  27. mas.Name = "CompiledModel"
  28. o1 = Instance.new("Model")
  29. o2 = Instance.new("Part")
  30. o3 = Instance.new("SpecialMesh")
  31. o4 = Instance.new("Sound")
  32. o5 = Instance.new("Sound")
  33. o6 = Instance.new("Sound")
  34. o7 = Instance.new("Sound")
  35. o8 = Instance.new("Sound")
  36. o9 = Instance.new("Sound")
  37. o10 = Instance.new("Sound")
  38. o11 = Instance.new("Sound")
  39. o12 = Instance.new("Sound")
  40. o13 = Instance.new("Sound")
  41. o14 = Instance.new("Part")
  42. o15 = Instance.new("Motor6D")
  43. o16 = Instance.new("Part")
  44. o17 = Instance.new("Part")
  45. o18 = Instance.new("Part")
  46. o19 = Instance.new("Part")
  47. o20 = Instance.new("Humanoid")
  48. o21 = Instance.new("Model")
  49. o22 = Instance.new("Part")
  50. o23 = Instance.new("Decal")
  51. o24 = Instance.new("Motor6D")
  52. o25 = Instance.new("Motor6D")
  53. o26 = Instance.new("Motor6D")
  54. o27 = Instance.new("Motor6D")
  55. o28 = Instance.new("Motor6D")
  56. o29 = Instance.new("Animation")
  57. o30 = Instance.new("Shirt")
  58. o31 = Instance.new("CharacterMesh")
  59. o32 = Instance.new("CharacterMesh")
  60. o33 = Instance.new("Pants")
  61. o34 = Instance.new("Script")
  62. o35 = Instance.new("CharacterMesh")
  63. o36 = Instance.new("CharacterMesh")
  64. o37 = Instance.new("CharacterMesh")
  65. o38 = Instance.new("Script")
  66. o39 = Instance.new("StringValue")
  67. o40 = Instance.new("Animation")
  68. o41 = Instance.new("StringValue")
  69. o42 = Instance.new("Animation")
  70. o43 = Instance.new("StringValue")
  71. o44 = Instance.new("Animation")
  72. o45 = Instance.new("NumberValue")
  73. o46 = Instance.new("Animation")
  74. o47 = Instance.new("NumberValue")
  75. o48 = Instance.new("StringValue")
  76. o49 = Instance.new("Animation")
  77. o50 = Instance.new("StringValue")
  78. o51 = Instance.new("Animation")
  79. o52 = Instance.new("StringValue")
  80. o53 = Instance.new("Animation")
  81. o54 = Instance.new("StringValue")
  82. o55 = Instance.new("Animation")
  83. o56 = Instance.new("StringValue")
  84. o57 = Instance.new("Animation")
  85. o58 = Instance.new("BodyColors")
  86. o1.Name = "Twitcher"
  87. o1.Parent = mas
  88. o1.PrimaryPart = o2
  89. o2.Name = "Head"
  90. o2.Parent = o1
  91. o2.BrickColor = BrickColor.new("Sand red")
  92. o2.Position = Vector3.new(-33.9538841, 4.3830204, -158)
  93. o2.Rotation = Vector3.new(0, 0, -40)
  94. o2.CanCollide = false
  95. o2.Locked = true
  96. o2.Elasticity = 0
  97. o2.FormFactor = Enum.FormFactor.Symmetric
  98. o2.Friction = 2
  99. o2.Size = Vector3.new(2, 1, 1)
  100. o2.CFrame = CFrame.new(-33.9538841, 4.3830204, -158, 0.766044438, 0.642787576, 0, -0.642787576, 0.766044438, 0, 0, 0, 1)
  101. o2.TopSurface = Enum.SurfaceType.Smooth
  102. o2.Color = Color3.new(0.584314, 0.47451, 0.466667)
  103. o2.Position = Vector3.new(-33.9538841, 4.3830204, -158)
  104. o3.Parent = o2
  105. o3.MeshId = "http://www.roblox.com/asset/?id=17392637"
  106. o3.TextureId = "http://www.roblox.com/asset/?id=187752481"
  107. o3.MeshType = Enum.MeshType.FileMesh
  108. o4.Name = "zo_pain2"
  109. o4.Parent = o2
  110. o4.SoundId = "http://www.roblox.com/asset/?id=187645851"
  111. o4.Volume = 1
  112. o5.Name = "zo_clawstrike1"
  113. o5.Parent = o2
  114. o5.SoundId = "rbxassetid://187645424"
  115. o5.Volume = 1
  116. o6.Name = "zo_clawstrike2"
  117. o6.Parent = o2
  118. o6.SoundId = "rbxassetid://187645448"
  119. o6.Volume = 1
  120. o7.Name = "zo_clawstrike3"
  121. o7.Parent = o2
  122. o7.SoundId = "rbxassetid://187645481"
  123. o7.Volume = 1
  124. o8.Name = "zo_attack1"
  125. o8.Parent = o2
  126. o8.SoundId = "rbxassetid://187645787"
  127. o8.Volume = 1
  128. o9.Name = "zo_attack2"
  129. o9.Parent = o2
  130. o9.SoundId = "rbxassetid://187645811"
  131. o9.Volume = 1
  132. o10.Name = "zo_alert10"
  133. o10.Parent = o2
  134. o10.SoundId = "http://www.roblox.com/asset/?id=187645728"
  135. o10.Volume = 1
  136. o11.Name = "zo_alert20"
  137. o11.Parent = o2
  138. o11.SoundId = "http://www.roblox.com/asset/?id=187645755"
  139. o11.Volume = 1
  140. o12.Name = "zo_alert30"
  141. o12.Parent = o2
  142. o12.SoundId = "http://www.roblox.com/asset/?id=187645778"
  143. o12.Volume = 1
  144. o13.Name = "zo_pain1"
  145. o13.Parent = o2
  146. o13.SoundId = "http://www.roblox.com/asset/?id=187645836"
  147. o13.Volume = 1
  148. o14.Name = "HumanoidRootPart"
  149. o14.Parent = o1
  150. o14.BrickColor = BrickColor.new("Bright blue")
  151. o14.Transparency = 1
  152. o14.Position = Vector3.new(-34, 2.99999905, -158)
  153. o14.Anchored = true
  154. o14.CanCollide = false
  155. o14.Locked = true
  156. o14.Elasticity = 0
  157. o14.FormFactor = Enum.FormFactor.Symmetric
  158. o14.Friction = 2
  159. o14.Size = Vector3.new(2, 2, 1)
  160. o14.CFrame = CFrame.new(-34, 2.99999905, -158, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  161. o14.BottomSurface = Enum.SurfaceType.Smooth
  162. o14.TopSurface = Enum.SurfaceType.Smooth
  163. o14.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  164. o14.Position = Vector3.new(-34, 2.99999905, -158)
  165. o15.Name = "RootJoint"
  166. o15.Parent = o14
  167. o15.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  168. o15.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  169. o15.Part0 = o14
  170. o15.Part1 = o22
  171. o15.MaxVelocity = 0.10000000149012
  172. o16.Name = "Right Leg"
  173. o16.Parent = o1
  174. o16.BrickColor = BrickColor.new("Brick yellow")
  175. o16.Position = Vector3.new(-33.4924049, 0.999999046, -158.086823)
  176. o16.Rotation = Vector3.new(0, -10, 0)
  177. o16.CanCollide = false
  178. o16.Locked = true
  179. o16.Elasticity = 0
  180. o16.FormFactor = Enum.FormFactor.Symmetric
  181. o16.Friction = 2
  182. o16.Size = Vector3.new(1, 2, 1)
  183. o16.CFrame = CFrame.new(-33.4924049, 0.999999046, -158.086823, 0.984807789, 0, -0.17364797, 0, 1, 0, 0.17364797, 0, 0.984807789)
  184. o16.BottomSurface = Enum.SurfaceType.Smooth
  185. o16.Color = Color3.new(0.843137, 0.772549, 0.603922)
  186. o16.Position = Vector3.new(-33.4924049, 0.999999046, -158.086823)
  187. o17.Name = "Left Leg"
  188. o17.Parent = o1
  189. o17.BrickColor = BrickColor.new("Brick yellow")
  190. o17.Position = Vector3.new(-34.5075951, 0.999999046, -158.086823)
  191. o17.Rotation = Vector3.new(0, 10, 0)
  192. o17.CanCollide = false
  193. o17.Locked = true
  194. o17.Elasticity = 0
  195. o17.FormFactor = Enum.FormFactor.Symmetric
  196. o17.Friction = 2
  197. o17.Size = Vector3.new(1, 2, 1)
  198. o17.CFrame = CFrame.new(-34.5075951, 0.999999046, -158.086823, 0.98480773, 0, 0.173648149, 0, 1, 0, -0.173648149, 0, 0.98480773)
  199. o17.BottomSurface = Enum.SurfaceType.Smooth
  200. o17.Color = Color3.new(0.843137, 0.772549, 0.603922)
  201. o17.Position = Vector3.new(-34.5075951, 0.999999046, -158.086823)
  202. o18.Name = "Right Arm"
  203. o18.Parent = o1
  204. o18.BrickColor = BrickColor.new("Black")
  205. o18.Position = Vector3.new(-32.3169861, 3.34150577, -158.091507)
  206. o18.Rotation = Vector3.new(30, 0, 30)
  207. o18.CanCollide = false
  208. o18.Locked = true
  209. o18.Elasticity = 0
  210. o18.FormFactor = Enum.FormFactor.Symmetric
  211. o18.Friction = 2
  212. o18.Size = Vector3.new(1, 2, 1)
  213. o18.CFrame = CFrame.new(-32.3169861, 3.34150577, -158.091507, 0.866025388, -0.5, 0, 0.433012694, 0.75, -0.5, 0.25, 0.433012694, 0.866025388)
  214. o18.Color = Color3.new(0.105882, 0.164706, 0.207843)
  215. o18.Position = Vector3.new(-32.3169861, 3.34150577, -158.091507)
  216. o19.Name = "Left Arm"
  217. o19.Parent = o1
  218. o19.BrickColor = BrickColor.new("Black")
  219. o19.Position = Vector3.new(-35.6830139, 3.34150434, -158.091507)
  220. o19.Rotation = Vector3.new(30, 0, -30)
  221. o19.CanCollide = false
  222. o19.Locked = true
  223. o19.Elasticity = 0
  224. o19.FormFactor = Enum.FormFactor.Symmetric
  225. o19.Friction = 2
  226. o19.Size = Vector3.new(1, 2, 1)
  227. o19.CFrame = CFrame.new(-35.6830139, 3.34150434, -158.091507, 0.866025388, 0.5, 2.53130317e-09, -0.433012664, 0.74999994, -0.500000179, -0.250000089, 0.433012843, 0.866025329)
  228. o19.Color = Color3.new(0.105882, 0.164706, 0.207843)
  229. o19.Position = Vector3.new(-35.6830139, 3.34150434, -158.091507)
  230. o20.Parent = o1
  231. o20.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
  232. o20.RightLeg = o16
  233. o20.LeftLeg = o17
  234. o20.Torso = o14
  235. o20.Health = 150
  236. o20.MaxHealth = 150
  237. o20.WalkSpeed = 30
  238. o21.Name = "Status"
  239. o21.Parent = o20
  240. o22.Name = "Torso"
  241. o22.Parent = o1
  242. o22.BrickColor = BrickColor.new("Black")
  243. o22.Position = Vector3.new(-34, 2.99999905, -158)
  244. o22.CanCollide = false
  245. o22.Locked = true
  246. o22.Elasticity = 0
  247. o22.FormFactor = Enum.FormFactor.Symmetric
  248. o22.Friction = 2
  249. o22.Size = Vector3.new(2, 2, 1)
  250. o22.CFrame = CFrame.new(-34, 2.99999905, -158, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  251. o22.LeftSurface = Enum.SurfaceType.Weld
  252. o22.RightSurface = Enum.SurfaceType.Weld
  253. o22.Color = Color3.new(0.105882, 0.164706, 0.207843)
  254. o22.Position = Vector3.new(-34, 2.99999905, -158)
  255. o23.Name = "roblox"
  256. o23.Parent = o22
  257. o23.Texture = "http://www.roblox.com/asset/?id=47730520"
  258. o24.Name = "Right Shoulder"
  259. o24.Parent = o22
  260. o24.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  261. o24.C1 = CFrame.new(-0.500000954, 0.5, 0, -0.25, 0.433012694, 0.866025388, -0.433012694, 0.75, -0.5, -0.866025388, -0.5, 0)
  262. o24.Part0 = o22
  263. o24.Part1 = o18
  264. o24.MaxVelocity = 0.10000000149012
  265. o25.Name = "Left Shoulder"
  266. o25.Parent = o22
  267. o25.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  268. o25.C1 = CFrame.new(0.499999046, 0.500000954, 0, -0.250000089, -0.433012664, -0.866025388, 0.433012843, 0.74999994, -0.5, 0.866025329, -0.500000179, -2.53130317e-09)
  269. o25.Part0 = o22
  270. o25.Part1 = o19
  271. o25.MaxVelocity = 0.10000000149012
  272. o26.Name = "Right Hip"
  273. o26.Parent = o22
  274. o26.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  275. o26.C1 = CFrame.new(0.5, 1, 0, -0.17364797, 0, 0.984807789, 0, 1, 0, -0.984807789, 0, -0.17364797)
  276. o26.Part0 = o22
  277. o26.Part1 = o16
  278. o26.MaxVelocity = 0.10000000149012
  279. o27.Name = "Left Hip"
  280. o27.Parent = o22
  281. o27.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  282. o27.C1 = CFrame.new(-0.500000954, 1, 0, -0.173648149, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, -0.173648149)
  283. o27.Part0 = o22
  284. o27.Part1 = o17
  285. o27.MaxVelocity = 0.10000000149012
  286. o28.Name = "Neck"
  287. o28.Parent = o22
  288. o28.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  289. o28.C1 = CFrame.new(0.210875511, -0.32305336, 0, -0.766044438, 0, -0.642787576, -0.642787576, 0, 0.766044438, 0, 1, 0)
  290. o28.Part0 = o22
  291. o28.Part1 = o2
  292. o28.MaxVelocity = 0.10000000149012
  293. o29.Name = "CloseAttackAnim"
  294. o29.Parent = o1
  295. o29.AnimationId = "rbxassetid://94160738"
  296. o30.Name = "Shirt"
  297. o30.Parent = o1
  298. o30.ShirtTemplate = "rbxassetid://187751943"
  299. o31.Name = "Roblox 2.0 Right Leg"
  300. o31.Parent = o1
  301. o31.MeshId = 27111882
  302. o31.BodyPart = Enum.BodyPart.RightLeg
  303. o32.Name = "Roblox 2.0 torso"
  304. o32.Parent = o1
  305. o32.MeshId = 27111894
  306. o32.BodyPart = Enum.BodyPart.Torso
  307. o33.Name = "Pants"
  308. o33.Parent = o1
  309. o33.PantsTemplate = "rbxassetid://187752312"
  310. o34.Name = "TwitcherTargetScript"
  311. o34.Parent = o1
  312. table.insert(cors,coroutine.create(function()
  313. wait()
  314. runDummyScript(function()
  315. --[[ By: Brutez ]]--
  316. local TwitcherMainScript = script;
  317. local Twitcher = TwitcherMainScript.Parent;
  318. local Head = Twitcher:FindFirstChild("Head");
  319. local HumanoidRootPart = Twitcher:FindFirstChild("HumanoidRootPart");
  320. local LeftArm = Twitcher:FindFirstChild("Left Arm");
  321. local LeftLeg = Twitcher:FindFirstChild("Left Leg");
  322. local RightArm = Twitcher:FindFirstChild("Right Arm");
  323. local RightLeg = Twitcher:FindFirstChild("Right Leg");
  324. local Torso = Twitcher:FindFirstChild("Torso");
  325. local TwitcherHumanoid = Twitcher:FindFirstChild("Humanoid");
  326. local AxeIsOut = false;
  327. local AxeEnabled = true;
  328. local TwitcherAttackAnimation = TwitcherHumanoid:LoadAnimation(Twitcher.CloseAttackAnim);
  329. local TwitcherAlertSounds = {Head.zo_alert10,Head.zo_alert20,Head.zo_alert30};
  330. local TwitcherAttackSounds = {Head.zo_attack1,Head.zo_attack2};
  331. local TwitcherClawStrikeSounds = {Head.zo_clawstrike1,Head.zo_clawstrike2,Head.zo_clawstrike3};
  332. local TwitcherPainSounds = {Head.zo_pain1,Head.zo_pain2};
  333. repeat Wait(0) until TwitcherHumanoid ~= nil
  334. repeat TwitcherHumanoid:TakeDamage(10) TwitcherHumanoid.Health = TwitcherHumanoid.MaxHealth Wait(0) until TwitcherHumanoid.Health == TwitcherHumanoid.MaxHealth
  335. local SpawnForceField = Instance.new("ForceField")
  336. SpawnForceField.Name = "SpawnForceField"
  337. SpawnForceField.Parent = Twitcher
  338. function FollowTarget(TargetHumanoid, TargetTorso)
  339. if not TargetHumanoid or not TargetHumanoid.Parent or TargetHumanoid.Health == 0 or not TargetTorso or not TargetTorso.Parent then
  340. return
  341. end
  342. local TwitcherRadiusXAxis = math.random(-2,2)
  343. local TwitcherRadiusYAxis = math.random(-2,2)
  344. local TwitcherRadiusZAxis = math.random(-2,2)
  345. TwitcherHumanoid:MoveTo(TargetTorso.Position+Vector3.new(TwitcherRadiusXAxis,TwitcherRadiusYAxis,TwitcherRadiusZAxis), TargetTorso)
  346. end
  347. function ThunderAttack(TargetHumanoid, TargetTorso)
  348. if not TargetHumanoid or not TargetHumanoid.Parent or TargetHumanoid.Health == 0 or not TargetTorso or not TargetTorso.Parent then
  349. return
  350. end
  351. local TwitcherDamage = 5
  352. TwitcherAttackSounds[math.random(1,#TwitcherAttackSounds)]:Play()
  353. TwitcherHumanoid.WalkSpeed = 0
  354. Wait(0.3)
  355. TwitcherClawStrikeSounds[math.random(1,#TwitcherClawStrikeSounds)]:Play()
  356. if TargetTorso~=nil and(Torso.Position-TargetTorso.Position).magnitude<=7 then
  357. TargetHumanoid:TakeDamage(TwitcherDamage)
  358. end
  359. TwitcherAttackAnimation:Play();
  360. TwitcherAttackAnimation:AdjustSpeed(1.5);
  361. Wait(0.4)
  362. TwitcherAttackAnimation:Play();
  363. TwitcherAttackAnimation:AdjustSpeed(1.5);
  364. TwitcherClawStrikeSounds[math.random(1,#TwitcherClawStrikeSounds)]:Play()
  365. if TargetTorso~=nil and(Torso.Position-TargetTorso.Position).magnitude<=7 then
  366. TargetHumanoid:TakeDamage(TwitcherDamage)
  367. end
  368. Wait(0.21)
  369. TwitcherHumanoid.WalkSpeed = 30
  370. end
  371. function FindTarget()
  372. local ClosestCharacter
  373. local ClosestHumanoid = nil
  374. local ClosestTorso = nil
  375. local ClosestTorsoDistance = 99999e99999
  376. for TargetCount, TargetModel in pairs(Game.Workspace:GetChildren()) do
  377. if TargetModel:IsA("Model") and (TargetModel ~= Twitcher) and (TargetModel.Name ~= Twitcher.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "David Leatherhoff") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "GhostAbomination") then
  378. if TargetModel:FindFirstChild("Humanoid")~=nil then
  379. local humanoid = TargetModel:FindFirstChild("Humanoid")
  380. local torso = TargetModel:FindFirstChild("Torso")
  381. if torso ~= nil then
  382. local TorsoDistance = (torso.Position - Torso.Position).magnitude
  383. if humanoid and humanoid.Health > 0 and torso and TorsoDistance <= ClosestTorsoDistance then
  384. ClosestCharacter = TargetModel
  385. ClosestHumanoid = humanoid
  386. ClosestTorso = torso
  387. ClosestTorsoDistance = TorsoDistance
  388. end
  389. end
  390. end
  391. end
  392. end
  393. return ClosestCharacter, ClosestHumanoid, ClosestTorso
  394. end
  395. function FindTarget2()
  396. local ClosestCharacter
  397. local ClosestHumanoid = nil
  398. local ClosestTorso = nil
  399. local ClosestTorsoDistance = 5
  400. for TargetCount, TargetModel in pairs(Game.Workspace:GetChildren()) do
  401. if TargetModel:IsA("Model") and (TargetModel ~= Twitcher) and (TargetModel.Name ~= Twitcher.Name) and (TargetModel.Name ~= "Stranger") and (TargetModel.Name ~= "David Leatherhoff") and (TargetModel.Name ~= "HandCrab") and (TargetModel.Name ~= "GhostAbomination") then
  402. if TargetModel:FindFirstChild("Humanoid")~=nil then
  403. local humanoid = TargetModel:FindFirstChild("Humanoid")
  404. local torso = TargetModel:FindFirstChild("Torso")
  405. if torso ~= nil then
  406. local TorsoDistance = (torso.Position - Torso.Position).magnitude
  407. if humanoid and humanoid.Health > 0 and torso and TorsoDistance <= ClosestTorsoDistance then
  408. ClosestCharacter = TargetModel
  409. ClosestHumanoid = humanoid
  410. ClosestTorso = torso
  411. ClosestTorsoDistance = TorsoDistance
  412. end
  413. end
  414. end
  415. end
  416. end
  417. return ClosestCharacter, ClosestHumanoid, ClosestTorso
  418. end
  419. Wait(5)
  420. for DavidHealthCheck = 1,5 do
  421. TwitcherHumanoid.Health = TwitcherHumanoid.MaxHealth
  422. Wait(0)
  423. end
  424. HumanoidRootPart.Anchored = false
  425. SpawnForceField:Destroy()
  426. function HurtSound(HumanoidData)
  427. if TwitcherHumanoid.Health<0 or TwitcherHumanoid.Health==0 then return end
  428. TwitcherPainSounds[math.random(1,#TwitcherPainSounds)]:Play()
  429. TwitcherPainSounds[math.random(1,#TwitcherPainSounds)].Pitch = 1 + (math.random() * 0.07)
  430. end
  431. TwitcherHumanoid.HealthChanged:connect(HurtSound)
  432. while Wait(0) do
  433. if TwitcherHumanoid.Health == 0 or TwitcherHumanoid.Health < 0 then
  434. TwitcherHumanoid.WalkSpeed = 0
  435. script.Disabled = true
  436. Wait(5)
  437. Twitcher:Destroy()
  438. end
  439. if TwitcherHumanoid.Sit==true then
  440. TwitcherHumanoid.Jump=true
  441. end
  442. if TwitcherHumanoid.PlatformStand==true then
  443. TwitcherHumanoid.Jump=true
  444. end
  445. local character, humanoid, torso = FindTarget()
  446. if character and character.Parent and humanoid and humanoid.Parent and torso and torso.Parent then
  447. FollowTarget(humanoid, torso)
  448. end
  449. local character, humanoid, torso = FindTarget2()
  450. if character and character.Parent and humanoid and humanoid.Parent and torso and torso.Parent then
  451. ThunderAttack(humanoid, torso)
  452. end
  453. local TwitcherAlertSound = (math.random(1,500))
  454. if TwitcherAlertSound == 100 then
  455. TwitcherAlertSounds[math.random(1,#TwitcherAlertSounds)].Pitch = 1 + (math.random() * 0.07)
  456. TwitcherAlertSounds[math.random(1,#TwitcherAlertSounds)]:Play()
  457. end
  458. end
  459. --[[ By: Brutez ]]--
  460. end,o34)
  461. end))
  462. o35.Name = "Roblox 2.0 Left Arm"
  463. o35.Parent = o1
  464. o35.MeshId = 27111419
  465. o35.BodyPart = Enum.BodyPart.LeftArm
  466. o36.Name = "Roblox 2.0 Left Leg"
  467. o36.Parent = o1
  468. o36.MeshId = 27111857
  469. o36.BodyPart = Enum.BodyPart.LeftLeg
  470. o37.Name = "Roblox 2.0 Right Arm"
  471. o37.Parent = o1
  472. o37.MeshId = 27111864
  473. o37.BodyPart = Enum.BodyPart.RightArm
  474. o38.Name = "AnimateSauce"
  475. o38.Parent = o1
  476. table.insert(cors,coroutine.create(function()
  477. wait()
  478. runDummyScript(function()
  479. function waitForChild(parent, childName)
  480. local child = parent:findFirstChild(childName)
  481. if child then return child end
  482. while true do
  483. child = parent.ChildAdded:wait()
  484. if child.Name==childName then return child end
  485. end
  486. end
  487. local Figure = script.Parent
  488. local Torso = waitForChild(Figure, "Torso")
  489. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  490. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  491. local RightHip = waitForChild(Torso, "Right Hip")
  492. local LeftHip = waitForChild(Torso, "Left Hip")
  493. local Neck = waitForChild(Torso, "Neck")
  494. local Humanoid;
  495. for _,Child in pairs(Figure:GetChildren())do
  496. if Child and Child.ClassName=="Humanoid"then
  497. Humanoid=Child;
  498. end;
  499. end;
  500. local pose = "Standing"
  501. local currentAnim = ""
  502. local currentAnimInstance = nil
  503. local currentAnimTrack = nil
  504. local currentAnimKeyframeHandler = nil
  505. local currentAnimSpeed = 1.0
  506. local animTable = {}
  507. local animNames = {
  508. idle = {
  509. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  510. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  511. },
  512. walk = {
  513. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  514. },
  515. run = {
  516. { id = "run.xml", weight = 10 }
  517. },
  518. jump = {
  519. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  520. },
  521. fall = {
  522. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  523. },
  524. climb = {
  525. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  526. },
  527. sit = {
  528. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  529. },
  530. toolnone = {
  531. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  532. },
  533. toolslash = {
  534. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  535. --{ id = "slash.xml", weight = 10 }
  536. },
  537. toollunge = {
  538. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  539. },
  540. wave = {
  541. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  542. },
  543. point = {
  544. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  545. },
  546. dance1 = {
  547. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  548. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  549. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  550. },
  551. dance2 = {
  552. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  553. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  554. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  555. },
  556. dance3 = {
  557. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  558. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  559. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  560. },
  561. laugh = {
  562. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  563. },
  564. cheer = {
  565. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  566. },
  567. }
  568. local dances = {"dance1", "dance2", "dance3"}
  569.  
  570. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  571. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  572.  
  573. function configureAnimationSet(name, fileList)
  574. if (animTable[name] ~= nil) then
  575. for _, connection in pairs(animTable[name].connections) do
  576. connection:disconnect()
  577. end
  578. end
  579. animTable[name] = {}
  580. animTable[name].count = 0
  581. animTable[name].totalWeight = 0
  582. animTable[name].connections = {}
  583.  
  584. -- check for config values
  585. local config = script:FindFirstChild(name)
  586. if (config ~= nil) then
  587. --print("Loading anims " .. name)
  588. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  589. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  590. local idx = 1
  591. for _, childPart in pairs(config:GetChildren()) do
  592. if (childPart:IsA("Animation")) then
  593. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  594. animTable[name][idx] = {}
  595. animTable[name][idx].anim = childPart
  596. local weightObject = childPart:FindFirstChild("Weight")
  597. if (weightObject == nil) then
  598. animTable[name][idx].weight = 1
  599. else
  600. animTable[name][idx].weight = weightObject.Value
  601. end
  602. animTable[name].count = animTable[name].count + 1
  603. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  604. --print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  605. idx = idx + 1
  606. end
  607. end
  608. end
  609.  
  610. -- fallback to defaults
  611. if (animTable[name].count <= 0) then
  612. for idx, anim in pairs(fileList) do
  613. animTable[name][idx] = {}
  614. animTable[name][idx].anim = Instance.new("Animation")
  615. animTable[name][idx].anim.Name = name
  616. animTable[name][idx].anim.AnimationId = anim.id
  617. animTable[name][idx].weight = anim.weight
  618. animTable[name].count = animTable[name].count + 1
  619. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  620. --print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  621. end
  622. end
  623. end
  624.  
  625. -- Setup animation objects
  626. function scriptChildModified(child)
  627. local fileList = animNames[child.Name]
  628. if (fileList ~= nil) then
  629. configureAnimationSet(child.Name, fileList)
  630. end
  631. end
  632.  
  633. script.ChildAdded:connect(scriptChildModified)
  634. script.ChildRemoved:connect(scriptChildModified)
  635.  
  636.  
  637. for name, fileList in pairs(animNames) do
  638. configureAnimationSet(name, fileList)
  639. end
  640.  
  641. -- ANIMATION
  642.  
  643. -- declarations
  644. local toolAnim = "None"
  645. local toolAnimTime = 0
  646.  
  647. local jumpAnimTime = 0
  648. local jumpAnimDuration = 0.3
  649.  
  650. local toolTransitionTime = 0.1
  651. local fallTransitionTime = 0.3
  652. local jumpMaxLimbVelocity = 0.75
  653.  
  654. -- functions
  655.  
  656. function stopAllAnimations()
  657. local oldAnim = currentAnim
  658.  
  659. -- return to idle if finishing an emote
  660. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  661. oldAnim = "idle"
  662. end
  663.  
  664. currentAnim = ""
  665. currentAnimInstance = nil
  666. if (currentAnimKeyframeHandler ~= nil) then
  667. currentAnimKeyframeHandler:disconnect()
  668. end
  669.  
  670. if (currentAnimTrack ~= nil) then
  671. currentAnimTrack:Stop()
  672. currentAnimTrack:Destroy()
  673. currentAnimTrack = nil
  674. end
  675. return oldAnim
  676. end
  677.  
  678. function setAnimationSpeed(speed)
  679. if speed ~= currentAnimSpeed then
  680. currentAnimSpeed = speed
  681. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  682. end
  683. end
  684.  
  685. function keyFrameReachedFunc(frameName)
  686. if (frameName == "End") then
  687.  
  688. local repeatAnim = currentAnim
  689. -- return to idle if finishing an emote
  690. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  691. repeatAnim = "idle"
  692. end
  693.  
  694. local animSpeed = currentAnimSpeed
  695. playAnimation(repeatAnim, 0.0, Humanoid)
  696. setAnimationSpeed(animSpeed)
  697. end
  698. end
  699.  
  700. -- Preload animations
  701. function playAnimation(animName, transitionTime, humanoid)
  702.  
  703. local roll = math.random(1, animTable[animName].totalWeight)
  704. local origRoll = roll
  705. local idx = 1
  706. while (roll > animTable[animName][idx].weight) do
  707. roll = roll - animTable[animName][idx].weight
  708. idx = idx + 1
  709. end
  710. --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  711. local anim = animTable[animName][idx].anim
  712.  
  713. -- switch animation
  714. if (anim ~= currentAnimInstance) then
  715.  
  716. if (currentAnimTrack ~= nil) then
  717. currentAnimTrack:Stop(transitionTime)
  718. currentAnimTrack:Destroy()
  719. end
  720.  
  721. currentAnimSpeed = 1.0
  722.  
  723. -- load it to the humanoid; get AnimationTrack
  724. currentAnimTrack = humanoid:LoadAnimation(anim)
  725.  
  726. -- play the animation
  727. currentAnimTrack:Play(transitionTime)
  728. currentAnim = animName
  729. currentAnimInstance = anim
  730.  
  731. -- set up keyframe name triggers
  732. if (currentAnimKeyframeHandler ~= nil) then
  733. currentAnimKeyframeHandler:disconnect()
  734. end
  735. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  736.  
  737. end
  738.  
  739. end
  740.  
  741. -------------------------------------------------------------------------------------------
  742. -------------------------------------------------------------------------------------------
  743.  
  744. local toolAnimName = ""
  745. local toolAnimTrack = nil
  746. local toolAnimInstance = nil
  747. local currentToolAnimKeyframeHandler = nil
  748.  
  749. function toolKeyFrameReachedFunc(frameName)
  750. if (frameName == "End") then
  751. --print("Keyframe : ".. frameName)
  752. playToolAnimation(toolAnimName, 0.0, Humanoid)
  753. end
  754. end
  755.  
  756.  
  757. function playToolAnimation(animName, transitionTime, humanoid)
  758.  
  759. local roll = math.random(1, animTable[animName].totalWeight)
  760. local origRoll = roll
  761. local idx = 1
  762. while (roll > animTable[animName][idx].weight) do
  763. roll = roll - animTable[animName][idx].weight
  764. idx = idx + 1
  765. end
  766. --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  767. local anim = animTable[animName][idx].anim
  768.  
  769. if (toolAnimInstance ~= anim) then
  770.  
  771. if (toolAnimTrack ~= nil) then
  772. toolAnimTrack:Stop()
  773. toolAnimTrack:Destroy()
  774. transitionTime = 0
  775. end
  776.  
  777. -- load it to the humanoid; get AnimationTrack
  778. toolAnimTrack = humanoid:LoadAnimation(anim)
  779.  
  780. -- play the animation
  781. toolAnimTrack:Play(transitionTime)
  782. toolAnimName = animName
  783. toolAnimInstance = anim
  784.  
  785. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  786. end
  787. end
  788.  
  789. function stopToolAnimations()
  790. local oldAnim = toolAnimName
  791.  
  792. if (currentToolAnimKeyframeHandler ~= nil) then
  793. currentToolAnimKeyframeHandler:disconnect()
  794. end
  795.  
  796. toolAnimName = ""
  797. toolAnimInstance = nil
  798. if (toolAnimTrack ~= nil) then
  799. toolAnimTrack:Stop()
  800. toolAnimTrack:Destroy()
  801. toolAnimTrack = nil
  802. end
  803.  
  804.  
  805. return oldAnim
  806. end
  807.  
  808. -------------------------------------------------------------------------------------------
  809. -------------------------------------------------------------------------------------------
  810.  
  811.  
  812. function onRunning(speed)
  813. if speed>0.01 then
  814. playAnimation("walk", 0.1, Humanoid)
  815. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  816. setAnimationSpeed(speed / 14.5)
  817. end
  818. pose = "Running"
  819. else
  820. playAnimation("idle", 0.1, Humanoid)
  821. pose = "Standing"
  822. end
  823. end
  824.  
  825. function onDied()
  826. pose = "Dead"
  827. end
  828.  
  829. function onJumping()
  830. playAnimation("jump", 0.1, Humanoid)
  831. jumpAnimTime = jumpAnimDuration
  832. pose = "Jumping"
  833. end
  834.  
  835. function onClimbing(speed)
  836. playAnimation("climb", 0.1, Humanoid)
  837. setAnimationSpeed(speed / 12.0)
  838. pose = "Climbing"
  839. end
  840.  
  841. function onGettingUp()
  842. pose = "GettingUp"
  843. end
  844.  
  845. function onFreeFall()
  846. if (jumpAnimTime <= 0) then
  847. playAnimation("fall", fallTransitionTime, Humanoid)
  848. end
  849. pose = "FreeFall"
  850. end
  851.  
  852. function onFallingDown()
  853. pose = "FallingDown"
  854. end
  855.  
  856. function onSeated()
  857. pose = "Seated"
  858. end
  859.  
  860. function onPlatformStanding()
  861. pose = "PlatformStanding"
  862. end
  863.  
  864. function onSwimming(speed)
  865. if speed>0 then
  866. pose = "Running"
  867. else
  868. pose = "Standing"
  869. end
  870. end
  871.  
  872. function getTool()
  873. for _, kid in ipairs(Figure:GetChildren()) do
  874. if kid.className == "Tool" then return kid end
  875. end
  876. return nil
  877. end
  878.  
  879. function getToolAnim(tool)
  880. for _, c in ipairs(tool:GetChildren()) do
  881. if c.Name == "toolanim" and c.className == "StringValue" then
  882. return c
  883. end
  884. end
  885. return nil
  886. end
  887.  
  888. function animateTool()
  889.  
  890. if (toolAnim == "None") then
  891. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  892. return
  893. end
  894.  
  895. if (toolAnim == "Slash") then
  896. playToolAnimation("toolslash", 0, Humanoid)
  897. return
  898. end
  899.  
  900. if (toolAnim == "Lunge") then
  901. playToolAnimation("toollunge", 0, Humanoid)
  902. return
  903. end
  904. end
  905.  
  906. function moveSit()
  907. RightShoulder.MaxVelocity = 0.15
  908. LeftShoulder.MaxVelocity = 0.15
  909. RightShoulder:SetDesiredAngle(3.14 /2)
  910. LeftShoulder:SetDesiredAngle(-3.14 /2)
  911. RightHip:SetDesiredAngle(3.14 /2)
  912. LeftHip:SetDesiredAngle(-3.14 /2)
  913. end
  914.  
  915. local lastTick = 0
  916.  
  917. function move(time)
  918. local amplitude = 1
  919. local frequency = 1
  920. local deltaTime = time - lastTick
  921. lastTick = time
  922.  
  923. local climbFudge = 0
  924. local setAngles = false
  925.  
  926. if (jumpAnimTime > 0) then
  927. jumpAnimTime = jumpAnimTime - deltaTime
  928. end
  929.  
  930. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  931. playAnimation("fall", fallTransitionTime, Humanoid)
  932. elseif (pose == "Seated") then
  933. playAnimation("sit", 0.5, Humanoid)
  934. return
  935. elseif (pose == "Running") then
  936. playAnimation("walk", 0.1, Humanoid)
  937. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  938. --print("Wha " .. pose)
  939. stopAllAnimations()
  940. amplitude = 0.1
  941. frequency = 1
  942. setAngles = true
  943. end
  944.  
  945. if (setAngles) then
  946. local desiredAngle = amplitude * math.sin(time * frequency)
  947. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  948. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  949. RightHip:SetDesiredAngle(-desiredAngle)
  950. LeftHip:SetDesiredAngle(-desiredAngle)
  951. end
  952.  
  953. -- Tool Animation handling
  954. local tool = getTool()
  955. if tool and tool:FindFirstChild("Handle") then
  956.  
  957. animStringValueObject = getToolAnim(tool)
  958.  
  959. if animStringValueObject then
  960. toolAnim = animStringValueObject.Value
  961. -- message recieved, delete StringValue
  962. animStringValueObject.Parent = nil
  963. toolAnimTime = time + .3
  964. end
  965.  
  966. if time > toolAnimTime then
  967. toolAnimTime = 0
  968. toolAnim = "None"
  969. end
  970.  
  971. animateTool()
  972. else
  973. stopToolAnimations()
  974. toolAnim = "None"
  975. toolAnimInstance = nil
  976. toolAnimTime = 0
  977. end
  978. end
  979.  
  980. -- connect events
  981. Humanoid.Died:connect(onDied)
  982. Humanoid.Running:connect(onRunning)
  983. Humanoid.Jumping:connect(onJumping)
  984. Humanoid.Climbing:connect(onClimbing)
  985. Humanoid.GettingUp:connect(onGettingUp)
  986. Humanoid.FreeFalling:connect(onFreeFall)
  987. Humanoid.FallingDown:connect(onFallingDown)
  988. Humanoid.Seated:connect(onSeated)
  989. Humanoid.PlatformStanding:connect(onPlatformStanding)
  990. Humanoid.Swimming:connect(onSwimming)
  991. local runService = game:service("RunService");
  992. -- initialize to idle
  993. playAnimation("idle", 0.1, Humanoid);
  994. pose = "Standing";
  995. while Wait(0)do
  996. move(0);
  997. end;
  998. end,o38)
  999. end))
  1000. o39.Name = "climb"
  1001. o39.Parent = o38
  1002. o40.Name = "ClimbAnim"
  1003. o40.Parent = o39
  1004. o40.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1005. o41.Name = "fall"
  1006. o41.Parent = o38
  1007. o42.Name = "FallAnim"
  1008. o42.Parent = o41
  1009. o42.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1010. o43.Name = "idle"
  1011. o43.Parent = o38
  1012. o44.Name = "Animation1"
  1013. o44.Parent = o43
  1014. o44.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1015. o45.Name = "Weight"
  1016. o45.Parent = o44
  1017. o45.Value = 9
  1018. o46.Name = "Animation2"
  1019. o46.Parent = o43
  1020. o46.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1021. o47.Name = "Weight"
  1022. o47.Parent = o46
  1023. o47.Value = 1
  1024. o48.Name = "jump"
  1025. o48.Parent = o38
  1026. o49.Name = "JumpAnim"
  1027. o49.Parent = o48
  1028. o49.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1029. o50.Name = "run"
  1030. o50.Parent = o38
  1031. o51.Name = "RunAnim"
  1032. o51.Parent = o50
  1033. o51.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1034. o52.Name = "sit"
  1035. o52.Parent = o38
  1036. o53.Name = "SitAnim"
  1037. o53.Parent = o52
  1038. o53.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1039. o54.Name = "toolnone"
  1040. o54.Parent = o38
  1041. o55.Name = "ToolNoneAnim"
  1042. o55.Parent = o54
  1043. o55.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1044. o56.Name = "walk"
  1045. o56.Parent = o38
  1046. o57.Name = "WalkAnim"
  1047. o57.Parent = o56
  1048. o57.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1049. o58.Parent = o1
  1050. o58.HeadColor = BrickColor.new("Sand red")
  1051. o58.LeftArmColor = BrickColor.new("Black")
  1052. o58.LeftLegColor = BrickColor.new("Brick yellow")
  1053. o58.RightArmColor = BrickColor.new("Black")
  1054. o58.RightLegColor = BrickColor.new("Brick yellow")
  1055. o58.TorsoColor = BrickColor.new("Black")
  1056. mas.Parent = workspace
  1057. mas:MakeJoints()
  1058. local mas1 = mas:GetChildren()
  1059. for i=1,#mas1 do
  1060. mas1[i].Parent = script
  1061. ypcall(function() mas1[i]:MakeJoints() end)
  1062. end
  1063. mas:Destroy()
  1064. for i=1,#cors do
  1065. coroutine.resume(cors[i])
  1066. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement