Advertisement
Vintage-Furry

56654

Dec 24th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.23 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. --Converted with ttyyuu12345's model to script plugin v4
  85. function sandbox(var,func)
  86. local env = getfenv(func)
  87. local newenv = setmetatable({},{
  88. __index = function(self,k)
  89. if k=="script" then
  90. return var
  91. else
  92. return env[k]
  93. end
  94. end,
  95. })
  96. setfenv(func,newenv)
  97. return func
  98. end
  99. cors = {}
  100. mas = Instance.new("Model",game:GetService("Lighting"))
  101. Model0 = Instance.new("Model")
  102. Part1 = Instance.new("Part")
  103. SpecialMesh2 = Instance.new("SpecialMesh")
  104. Script3 = Instance.new("Script")
  105. Part4 = Instance.new("Part")
  106. Part5 = Instance.new("Part")
  107. Part6 = Instance.new("Part")
  108. Humanoid7 = Instance.new("Humanoid")
  109. Part8 = Instance.new("Part")
  110. Motor6D9 = Instance.new("Motor6D")
  111. Script10 = Instance.new("Script")
  112. Part11 = Instance.new("Part")
  113. Motor6D12 = Instance.new("Motor6D")
  114. Motor6D13 = Instance.new("Motor6D")
  115. Motor6D14 = Instance.new("Motor6D")
  116. Motor6D15 = Instance.new("Motor6D")
  117. Motor6D16 = Instance.new("Motor6D")
  118. Script17 = Instance.new("Script")
  119. Folder18 = Instance.new("Folder")
  120. Animation19 = Instance.new("Animation")
  121. NumberValue20 = Instance.new("NumberValue")
  122. Animation21 = Instance.new("Animation")
  123. NumberValue22 = Instance.new("NumberValue")
  124. Animation23 = Instance.new("Animation")
  125. NumberValue24 = Instance.new("NumberValue")
  126. Folder25 = Instance.new("Folder")
  127. Animation26 = Instance.new("Animation")
  128. Animation27 = Instance.new("Animation")
  129. ParticleEmitter28 = Instance.new("ParticleEmitter")
  130. Script29 = Instance.new("Script")
  131. ParticleEmitter30 = Instance.new("ParticleEmitter")
  132. Sound31 = Instance.new("Sound")
  133. Script32 = Instance.new("Script")
  134. BillboardGui33 = Instance.new("BillboardGui")
  135. ImageLabel34 = Instance.new("ImageLabel")
  136. Script35 = Instance.new("Script")
  137. BillboardGui36 = Instance.new("BillboardGui")
  138. ImageLabel37 = Instance.new("ImageLabel")
  139. Part38 = Instance.new("Part")
  140. Script39 = Instance.new("Script")
  141. StringValue40 = Instance.new("StringValue")
  142. Animation41 = Instance.new("Animation")
  143. StringValue42 = Instance.new("StringValue")
  144. Animation43 = Instance.new("Animation")
  145. StringValue44 = Instance.new("StringValue")
  146. Animation45 = Instance.new("Animation")
  147. NumberValue46 = Instance.new("NumberValue")
  148. Animation47 = Instance.new("Animation")
  149. NumberValue48 = Instance.new("NumberValue")
  150. StringValue49 = Instance.new("StringValue")
  151. Animation50 = Instance.new("Animation")
  152. StringValue51 = Instance.new("StringValue")
  153. Animation52 = Instance.new("Animation")
  154. StringValue53 = Instance.new("StringValue")
  155. Animation54 = Instance.new("Animation")
  156. StringValue55 = Instance.new("StringValue")
  157. Animation56 = Instance.new("Animation")
  158. StringValue57 = Instance.new("StringValue")
  159. Animation58 = Instance.new("Animation")
  160. Script59 = Instance.new("Script")
  161. Folder60 = Instance.new("Folder")
  162. Animation61 = Instance.new("Animation")
  163. NumberValue62 = Instance.new("NumberValue")
  164. Animation63 = Instance.new("Animation")
  165. NumberValue64 = Instance.new("NumberValue")
  166. Animation65 = Instance.new("Animation")
  167. NumberValue66 = Instance.new("NumberValue")
  168. Folder67 = Instance.new("Folder")
  169. Animation68 = Instance.new("Animation")
  170. Animation69 = Instance.new("Animation")
  171. Animation70 = Instance.new("Animation")
  172. Animation71 = Instance.new("Animation")
  173. Animation72 = Instance.new("Animation")
  174. ParticleEmitter73 = Instance.new("ParticleEmitter")
  175. Script74 = Instance.new("Script")
  176. Sound75 = Instance.new("Sound")
  177. Sound76 = Instance.new("Sound")
  178. Script77 = Instance.new("Script")
  179. Sound78 = Instance.new("Sound")
  180. Script79 = Instance.new("Script")
  181. ParticleEmitter80 = Instance.new("ParticleEmitter")
  182. Sound81 = Instance.new("Sound")
  183. Shirt82 = Instance.new("Shirt")
  184. Pants83 = Instance.new("Pants")
  185. Script84 = Instance.new("Script")
  186. Camera85 = Instance.new("Camera")
  187. BodyColors86 = Instance.new("BodyColors")
  188. BodyColors87 = Instance.new("BodyColors")
  189. Model0.Name = "fight me"
  190. Model0.Parent = mas
  191. Part1.Name = "Head"
  192. Part1.Parent = Model0
  193. Part1.CFrame = CFrame.new(-243.66864, 5.31002808, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  194. Part1.Orientation = Vector3.new(0, 180, 0)
  195. Part1.Position = Vector3.new(-243.66864, 5.31002808, 45.1103287)
  196. Part1.Rotation = Vector3.new(-180, 0, -180)
  197. Part1.Color = Color3.new(0.917647, 0.721569, 0.572549)
  198. Part1.Size = Vector3.new(2.3599999, 1.17999995, 1.17999995)
  199. Part1.BottomSurface = Enum.SurfaceType.Smooth
  200. Part1.BrickColor = BrickColor.new("Light orange")
  201. Part1.TopSurface = Enum.SurfaceType.Smooth
  202. Part1.brickColor = BrickColor.new("Light orange")
  203. Part1.FormFactor = Enum.FormFactor.Symmetric
  204. Part1.formFactor = Enum.FormFactor.Symmetric
  205. SpecialMesh2.Parent = Part1
  206. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  207. Script3.Name = "qPerfectionWeld"
  208. Script3.Parent = Part1
  209. table.insert(cors,sandbox(Script3,function()
  210. -- Created by Quenty (@Quenty, follow me on twitter).
  211. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  212. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  213.  
  214. --[[ INSTRUCTIONS
  215. - Place in the model
  216. - Make sure model is anchored
  217. - That's it. It will weld the model and all children.
  218.  
  219. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  220. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  221. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  222. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  223. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  224. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  225. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  226. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  227.  
  228. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  229. ]]
  230.  
  231. --[[ DOCUMENTATION
  232. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  233. - Will work in PBS servers
  234. - Will work as long as it starts out with the part anchored
  235. - Stores the relative CFrame as a CFrame value
  236. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  237. - Utilizes a recursive algorith to find all parts in the model
  238. - Will reweld on script reparent if the script is initially parented to a tool.
  239. - Welds as fast as possible
  240. ]]
  241.  
  242. -- qPerfectionWeld.lua
  243. -- Created 10/6/2014
  244. -- Author: Quenty
  245. -- Version 1.0.3
  246.  
  247. -- Updated 10/14/2014 - Updated to 1.0.1
  248. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  249.  
  250. -- Updated 10/14/2014 - Updated to 1.0.2
  251. --- Fixed bug fix.
  252.  
  253. -- Updated 10/14/2014 - Updated to 1.0.3
  254. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  255.  
  256. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  257.  
  258.  
  259. local function CallOnChildren(Instance, FunctionToCall)
  260. -- Calls a function on each of the children of a certain object, using recursion.
  261.  
  262. FunctionToCall(Instance)
  263.  
  264. for _, Child in next, Instance:GetChildren() do
  265. CallOnChildren(Child, FunctionToCall)
  266. end
  267. end
  268.  
  269. local function GetNearestParent(Instance, ClassName)
  270. -- Returns the nearest parent of a certain class, or returns nil
  271.  
  272. local Ancestor = Instance
  273. repeat
  274. Ancestor = Ancestor.Parent
  275. if Ancestor == nil then
  276. return nil
  277. end
  278. until Ancestor:IsA(ClassName)
  279.  
  280. return Ancestor
  281. end
  282.  
  283. local function GetBricks(StartInstance)
  284. local List = {}
  285.  
  286. -- if StartInstance:IsA("BasePart") then
  287. -- List[#List+1] = StartInstance
  288. -- end
  289.  
  290. CallOnChildren(StartInstance, function(Item)
  291. if Item:IsA("BasePart") then
  292. List[#List+1] = Item;
  293. end
  294. end)
  295.  
  296. return List
  297. end
  298.  
  299. local function Modify(Instance, Values)
  300. -- Modifies an Instance by using a table.
  301.  
  302. assert(type(Values) == "table", "Values is not a table");
  303.  
  304. for Index, Value in next, Values do
  305. if type(Index) == "number" then
  306. Value.Parent = Instance
  307. else
  308. Instance[Index] = Value
  309. end
  310. end
  311. return Instance
  312. end
  313.  
  314. local function Make(ClassType, Properties)
  315. -- Using a syntax hack to create a nice way to Make new items.
  316.  
  317. return Modify(Instance.new(ClassType), Properties)
  318. end
  319.  
  320. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  321. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  322.  
  323. local function HasWheelJoint(Part)
  324. for _, SurfaceName in pairs(Surfaces) do
  325. for _, HingSurfaceName in pairs(HingSurfaces) do
  326. if Part[SurfaceName].Name == HingSurfaceName then
  327. return true
  328. end
  329. end
  330. end
  331.  
  332. return false
  333. end
  334.  
  335. local function ShouldBreakJoints(Part)
  336. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  337. -- definitely some edge cases.
  338.  
  339. if NEVER_BREAK_JOINTS then
  340. return false
  341. end
  342.  
  343. if HasWheelJoint(Part) then
  344. return false
  345. end
  346.  
  347. local Connected = Part:GetConnectedParts()
  348.  
  349. if #Connected == 1 then
  350. return false
  351. end
  352.  
  353. for _, Item in pairs(Connected) do
  354. if HasWheelJoint(Item) then
  355. return false
  356. elseif not Item:IsDescendantOf(script.Parent) then
  357. return false
  358. end
  359. end
  360.  
  361. return true
  362. end
  363.  
  364. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  365. --- Weld's 2 parts together
  366. -- @param Part0 The first part
  367. -- @param Part1 The second part (Dependent part most of the time).
  368. -- @param [JointType] The type of joint. Defaults to weld.
  369. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  370. -- @return The weld created.
  371.  
  372. JointType = JointType or "Weld"
  373. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  374.  
  375. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  376. Modify(NewWeld, {
  377. Name = "qCFrameWeldThingy";
  378. Part0 = Part0;
  379. Part1 = Part1;
  380. C0 = CFrame.new();--Part0.CFrame:inverse();
  381. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  382. Parent = Part1;
  383. })
  384.  
  385. if not RelativeValue then
  386. RelativeValue = Make("CFrameValue", {
  387. Parent = Part1;
  388. Name = "qRelativeCFrameWeldValue";
  389. Archivable = true;
  390. Value = NewWeld.C1;
  391. })
  392. end
  393.  
  394. return NewWeld
  395. end
  396.  
  397. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  398. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  399. -- @param MainPart The part to weld the model to (can be in the model).
  400. -- @param [JointType] The type of joint. Defaults to weld.
  401. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  402.  
  403. for _, Part in pairs(Parts) do
  404. if ShouldBreakJoints(Part) then
  405. Part:BreakJoints()
  406. end
  407. end
  408.  
  409. for _, Part in pairs(Parts) do
  410. if Part ~= MainPart then
  411. WeldTogether(MainPart, Part, JointType, MainPart)
  412. end
  413. end
  414.  
  415. if not DoNotUnanchor then
  416. for _, Part in pairs(Parts) do
  417. Part.Anchored = false
  418. end
  419. MainPart.Anchored = false
  420. end
  421. end
  422.  
  423. local function PerfectionWeld()
  424. local Tool = GetNearestParent(script, "Tool")
  425.  
  426. local Parts = GetBricks(script.Parent)
  427. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  428.  
  429. if PrimaryPart then
  430. WeldParts(Parts, PrimaryPart, "Weld", false)
  431. else
  432. warn("qWeld - Unable to weld part")
  433. end
  434.  
  435. return Tool
  436. end
  437.  
  438. local Tool = PerfectionWeld()
  439.  
  440.  
  441. if Tool and script.ClassName == "Script" then
  442. --- Don't bother with local scripts
  443.  
  444. script.Parent.AncestryChanged:connect(function()
  445. PerfectionWeld()
  446. end)
  447. end
  448.  
  449. -- Created by Quenty (@Quenty, follow me on twitter).
  450.  
  451. end))
  452. Part4.Name = "Left Leg"
  453. Part4.Parent = Model0
  454. Part4.CFrame = CFrame.new(-243.078644, 1.1800282, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  455. Part4.Orientation = Vector3.new(0, 180, 0)
  456. Part4.Position = Vector3.new(-243.078644, 1.1800282, 45.1103287)
  457. Part4.Rotation = Vector3.new(-180, 0, -180)
  458. Part4.Color = Color3.new(0.917647, 0.721569, 0.572549)
  459. Part4.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
  460. Part4.BottomSurface = Enum.SurfaceType.Smooth
  461. Part4.BrickColor = BrickColor.new("Light orange")
  462. Part4.CanCollide = false
  463. Part4.TopSurface = Enum.SurfaceType.Smooth
  464. Part4.brickColor = BrickColor.new("Light orange")
  465. Part4.FormFactor = Enum.FormFactor.Symmetric
  466. Part4.formFactor = Enum.FormFactor.Symmetric
  467. Part5.Name = "Right Arm"
  468. Part5.Parent = Model0
  469. Part5.CFrame = CFrame.new(-245.438644, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  470. Part5.Orientation = Vector3.new(0, 180, 0)
  471. Part5.Position = Vector3.new(-245.438644, 3.5400281, 45.1103287)
  472. Part5.Rotation = Vector3.new(-180, 0, -180)
  473. Part5.Color = Color3.new(0.917647, 0.721569, 0.572549)
  474. Part5.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
  475. Part5.BottomSurface = Enum.SurfaceType.Smooth
  476. Part5.BrickColor = BrickColor.new("Light orange")
  477. Part5.CanCollide = false
  478. Part5.TopSurface = Enum.SurfaceType.Smooth
  479. Part5.brickColor = BrickColor.new("Light orange")
  480. Part5.FormFactor = Enum.FormFactor.Symmetric
  481. Part5.formFactor = Enum.FormFactor.Symmetric
  482. Part6.Name = "Right Leg"
  483. Part6.Parent = Model0
  484. Part6.CFrame = CFrame.new(-244.258636, 1.1800282, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  485. Part6.Orientation = Vector3.new(0, 180, 0)
  486. Part6.Position = Vector3.new(-244.258636, 1.1800282, 45.1103287)
  487. Part6.Rotation = Vector3.new(-180, 0, -180)
  488. Part6.Color = Color3.new(0.917647, 0.721569, 0.572549)
  489. Part6.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
  490. Part6.BottomSurface = Enum.SurfaceType.Smooth
  491. Part6.BrickColor = BrickColor.new("Light orange")
  492. Part6.CanCollide = false
  493. Part6.TopSurface = Enum.SurfaceType.Smooth
  494. Part6.brickColor = BrickColor.new("Light orange")
  495. Part6.FormFactor = Enum.FormFactor.Symmetric
  496. Part6.formFactor = Enum.FormFactor.Symmetric
  497. Humanoid7.Parent = Model0
  498. Humanoid7.Health = inf
  499. Humanoid7.LeftLeg = Part4
  500. Humanoid7.MaxHealth = inf
  501. Humanoid7.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  502. Humanoid7.RightLeg = Part6
  503. Humanoid7.Torso = Part8
  504. Humanoid7.WalkSpeed = 20
  505. Humanoid7.maxHealth = inf
  506. Part8.Name = "HumanoidRootPart"
  507. Part8.Parent = Model0
  508. Part8.CFrame = CFrame.new(-243.66864, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  509. Part8.Orientation = Vector3.new(0, 180, 0)
  510. Part8.Position = Vector3.new(-243.66864, 3.5400281, 45.1103287)
  511. Part8.Rotation = Vector3.new(-180, 0, -180)
  512. Part8.Color = Color3.new(0.972549, 0.972549, 0.972549)
  513. Part8.Transparency = 1
  514. Part8.Size = Vector3.new(2.3599999, 2.3599999, 1.17999995)
  515. Part8.BottomSurface = Enum.SurfaceType.Smooth
  516. Part8.BrickColor = BrickColor.new("Institutional white")
  517. Part8.CanCollide = false
  518. Part8.LeftParamA = 0
  519. Part8.LeftParamB = 0
  520. Part8.RightParamA = 0
  521. Part8.RightParamB = 0
  522. Part8.TopSurface = Enum.SurfaceType.Smooth
  523. Part8.brickColor = BrickColor.new("Institutional white")
  524. Part8.FormFactor = Enum.FormFactor.Symmetric
  525. Part8.formFactor = Enum.FormFactor.Symmetric
  526. Motor6D9.Name = "RootJoint"
  527. Motor6D9.Parent = Part8
  528. Motor6D9.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  529. Motor6D9.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  530. Motor6D9.Part0 = Part8
  531. Motor6D9.Part1 = Part11
  532. Motor6D9.part1 = Part11
  533. Script10.Name = "Respawn"
  534. Script10.Parent = Model0
  535. table.insert(cors,sandbox(Script10,function()
  536. local humname = "Humanoid"
  537. local npc = script.Parent
  538. local home = npc.Parent
  539.  
  540.  
  541.  
  542. local clone = npc:Clone()
  543.  
  544.  
  545. while true do
  546. wait(5)
  547. if npc and npc.Parent and home then
  548. if npc:FindFirstChild(humname).Health < 1 then
  549. wait(5)
  550. local robot = clone:Clone()
  551. robot.Parent = home
  552. robot:MakeJoints()
  553. npc:Destroy()
  554. script.Disabled = true
  555. end
  556. end
  557. end
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566. end))
  567. Part11.Name = "Torso"
  568. Part11.Parent = Model0
  569. Part11.CFrame = CFrame.new(-243.66864, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  570. Part11.Orientation = Vector3.new(0, 180, 0)
  571. Part11.Position = Vector3.new(-243.66864, 3.5400281, 45.1103287)
  572. Part11.Rotation = Vector3.new(-180, 0, -180)
  573. Part11.Color = Color3.new(0.917647, 0.721569, 0.572549)
  574. Part11.Size = Vector3.new(2.3599999, 2.3599999, 1.17999995)
  575. Part11.BottomSurface = Enum.SurfaceType.Smooth
  576. Part11.BrickColor = BrickColor.new("Light orange")
  577. Part11.LeftParamA = 0
  578. Part11.LeftParamB = 0
  579. Part11.RightParamA = 0
  580. Part11.RightParamB = 0
  581. Part11.TopSurface = Enum.SurfaceType.Smooth
  582. Part11.brickColor = BrickColor.new("Light orange")
  583. Part11.FormFactor = Enum.FormFactor.Symmetric
  584. Part11.formFactor = Enum.FormFactor.Symmetric
  585. Motor6D12.Name = "Right Shoulder"
  586. Motor6D12.Parent = Part11
  587. Motor6D12.C0 = CFrame.new(1.17999995, 0.589999974, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  588. Motor6D12.C1 = CFrame.new(-0.589999974, 0.589999974, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  589. Motor6D12.Part0 = Part11
  590. Motor6D12.Part1 = Part5
  591. Motor6D12.part1 = Part5
  592. Motor6D13.Name = "Right Hip"
  593. Motor6D13.Parent = Part11
  594. Motor6D13.C0 = CFrame.new(1.17999995, -1.17999995, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  595. Motor6D13.C1 = CFrame.new(0.589999974, 1.17999995, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  596. Motor6D13.Part0 = Part11
  597. Motor6D13.Part1 = Part6
  598. Motor6D13.part1 = Part6
  599. Motor6D14.Name = "Left Hip"
  600. Motor6D14.Parent = Part11
  601. Motor6D14.C0 = CFrame.new(-1.17999995, -1.17999995, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  602. Motor6D14.C1 = CFrame.new(-0.589999974, 1.17999995, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  603. Motor6D14.Part0 = Part11
  604. Motor6D14.Part1 = Part4
  605. Motor6D14.part1 = Part4
  606. Motor6D15.Name = "Neck"
  607. Motor6D15.Parent = Part11
  608. Motor6D15.C0 = CFrame.new(0, 1.17999995, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  609. Motor6D15.C1 = CFrame.new(0, -0.589999974, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  610. Motor6D15.Part0 = Part11
  611. Motor6D15.Part1 = Part1
  612. Motor6D15.part1 = Part1
  613. Motor6D16.Name = "Left Shoulder"
  614. Motor6D16.Parent = Part11
  615. Motor6D16.C0 = CFrame.new(-1.17999995, 0.589999974, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  616. Motor6D16.C1 = CFrame.new(0.589999974, 0.589999974, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  617. Motor6D16.Part0 = Part11
  618. Motor6D16.Part1 = Part38
  619. Motor6D16.part1 = Part38
  620. Script17.Name = "Old script, just delete this"
  621. Script17.Parent = Model0
  622. table.insert(cors,sandbox(Script17,function()
  623. wait()
  624. --------------------- VARIABLES ---------------------------
  625.  
  626. local npc = script.Parent
  627. local torso = npc.Torso
  628. local hum = npc:findFirstChild("Humanoid")
  629. local target = npc.TargetTo
  630.  
  631. debounce = false
  632. punching = false
  633.  
  634.  
  635. local SpecialMoves = {
  636. "ShootFireball",
  637. "BlastFireball",
  638. "SpeedBoost"
  639. }
  640.  
  641.  
  642.  
  643.  
  644. --------------------- FUNCTIONS ---------------------------
  645.  
  646. function blastfireball()
  647. wait(1.2)
  648. --shoot fireball
  649. local part = Instance.new("Part")
  650. part.Name = "BigFireball"
  651. part.TopSurface = "Smooth"
  652. part.BottomSurface = "Smooth"
  653. part.Shape = "Ball"
  654. part.Size = Vector3.new(3, 3, 3)
  655. part.BrickColor = BrickColor.new("Deep orange")
  656. part.CanCollide = false
  657. part.Transparency = 0.3
  658. game.Debris:AddItem(part, 6)
  659.  
  660. local fire = script.FireEffect:Clone()
  661. fire.Enabled = true
  662. fire.Parent = part
  663.  
  664. local light = Instance.new("PointLight", part)
  665. light.Color = Color3.new(255, 205, 0)
  666. light.Range = 10
  667.  
  668. local velocity = Instance.new("BodyVelocity", part)
  669. velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  670. velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  671. part.Parent = game.Workspace
  672. part.CFrame = npc.Torso.CFrame * CFrame.new(0, 0, -5)
  673.  
  674. local s = script.FireballDamage:clone()
  675. s.Disabled = false
  676. s.Parent = part
  677.  
  678. local sound = script.FireballSound:clone()
  679. sound.Parent = part
  680. sound:Play()
  681. end
  682.  
  683.  
  684. function shootfireball()
  685. wait(0.6)
  686. local part = Instance.new("Part")
  687. part.Name = "Fireball"
  688. part.TopSurface = "Smooth"
  689. part.BottomSurface = "Smooth"
  690. part.Shape = "Ball"
  691. part.Size = Vector3.new(1.5,1.5,1.5)
  692. part.BrickColor = BrickColor.new("Deep orange")
  693. part.CanCollide = false
  694. part.Transparency = 0.3
  695. game.Debris:AddItem(part, 6)
  696.  
  697. local fire = script.FireEffect:Clone()
  698. fire.Enabled = true
  699. fire.Parent = part
  700.  
  701. local light = Instance.new("PointLight", part)
  702. light.Color = Color3.new(255, 205, 0)
  703. light.Range = 8
  704.  
  705. local s = script.FireballDamage:clone()
  706. s.Disabled = false
  707. s.Parent = part
  708.  
  709. local sound = script.FireballSound:clone()
  710. sound.Parent = part
  711. sound:Play()
  712.  
  713. local velocity = Instance.new("BodyVelocity", part)
  714. velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  715. velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  716. part.Parent = game.Workspace
  717. part.CFrame = npc.Torso.CFrame * CFrame.new(2, 0, 0)
  718.  
  719. wait(0.4) -----------------------------------------------------------------
  720.  
  721. local part = Instance.new("Part")
  722. part.Name = "Fireball"
  723. part.TopSurface = "Smooth"
  724. part.BottomSurface = "Smooth"
  725. part.Shape = "Ball"
  726. part.Size = Vector3.new(1.5,1.5,1.5)
  727. part.BrickColor = BrickColor.new("Deep orange")
  728. part.CanCollide = false
  729. part.Transparency = 0.3
  730. game.Debris:AddItem(part, 6)
  731.  
  732. local fire = script.FireEffect:Clone()
  733. fire.Enabled = true
  734. fire.Parent = part
  735.  
  736. local light = Instance.new("PointLight", part)
  737. light.Color = Color3.new(255, 205, 0)
  738. light.Range = 8
  739.  
  740. local s = script.FireballDamage:clone()
  741. s.Disabled = false
  742. s.Parent = part
  743.  
  744. local sound = script.FireballSound:clone()
  745. sound.Parent = part
  746. sound:Play()
  747.  
  748. local velocity = Instance.new("BodyVelocity", part)
  749. velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  750. velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  751. part.Parent = game.Workspace
  752. part.CFrame = npc.Torso.CFrame * CFrame.new(-2, 0, 0)
  753. end
  754.  
  755. function speedboost()
  756. local part = Instance.new("Part", game.Workspace)
  757. part.Name = "RadiusEffect"
  758. part.Shape = "Ball"
  759. part.CanCollide = false
  760. part.BrickColor = BrickColor.new("White")
  761. part.Size = Vector3.new(3,3,3)
  762. part.Anchored = true
  763. part.TopSurface = "Smooth"
  764. part.BottomSurface = "Smooth"
  765. part.Transparency = 0.1
  766. part.CFrame = npc:findFirstChild("Torso").CFrame
  767. game.Debris:AddItem(part, 3)
  768. for i = 1, 25 do --animate the ball
  769. part.Size = part.Size + Vector3.new(0.5,0.5,0.5)
  770. part.Transparency = part.Transparency + 0.04
  771. part.CFrame = torso.CFrame
  772. wait()
  773. end
  774. end
  775.  
  776.  
  777.  
  778.  
  779.  
  780. -------------------------------- MAIN SCRIPTS ------------------------------------
  781.  
  782. walkcount = 0
  783. function chase(p)
  784. if hum.Health > 0 then
  785. if p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil then
  786. debounce = true
  787. target.Value = p.Parent.Name
  788. for chance = 1, 20 do
  789. if debounce == true then --set to false if you don't want it to range attack
  790. walkcount = walkcount + 1
  791. end
  792.  
  793. if walkcount == 10 then
  794. local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
  795. if ChosenAttack == "ShootFireball" then
  796. hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
  797. shootfireball()
  798. end ----------------------------
  799. if ChosenAttack == "BlastFireball" then
  800. hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
  801. blastfireball()
  802. end
  803. if ChosenAttack == "SpeedBoost" then
  804. speedboost()
  805. hum.WalkSpeed = 16.5 --humanoid speed
  806. wait(5)
  807. hum.WalkSpeed = 12 --original speed
  808. end
  809. end
  810.  
  811. if punching == false then
  812. if p and p.Parent then
  813. hum:MoveTo(p.Parent.Torso.Position, p.Parent.Torso)
  814. end
  815. end
  816. wait(0.1)
  817. end
  818. walkcount = 0
  819. end
  820. end
  821. end
  822.  
  823.  
  824.  
  825. function attack(p)
  826. if hum.Health > 0 then
  827. if punching == false and p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil and p.Parent:findFirstChild("Humanoid").Health > 0 then
  828. local victim = p.Parent
  829. victim.Humanoid:TakeDamage(math.random(10, 15))
  830. --victim.Humanoid.Sit = true
  831. --add velocity or something
  832. victim.Torso.Velocity = torso.CFrame.lookVector * 50 + Vector3.new(0, 25, 0)
  833. punching = true
  834. local attackanimations = script.AttackAnimations:GetChildren()
  835. local chosenAnim = attackanimations[math.random(1, #attackanimations)]
  836. hum:LoadAnimation(chosenAnim):Play()
  837. wait(1)
  838. punching = false
  839. end
  840. end
  841. end
  842.  
  843. torso.Touched:connect(chase)
  844. torso.Touched:connect(attack)
  845.  
  846.  
  847.  
  848.  
  849. end))
  850. Script17.Disabled = true
  851. Folder18.Name = "AttackAnimations"
  852. Folder18.Parent = Script17
  853. Animation19.Name = "AttackAnim2"
  854. Animation19.Parent = Folder18
  855. Animation19.AnimationId = "rbxassetid://498292433"
  856. NumberValue20.Name = "CooldownTime"
  857. NumberValue20.Parent = Animation19
  858. NumberValue20.Value = 0.8
  859. Animation21.Name = "AttackAnim3"
  860. Animation21.Parent = Folder18
  861. Animation21.AnimationId = "rbxassetid://501476461"
  862. NumberValue22.Name = "CooldownTime"
  863. NumberValue22.Parent = Animation21
  864. NumberValue22.Value = 1
  865. Animation23.Name = "AttackAnim1"
  866. Animation23.Parent = Folder18
  867. Animation23.AnimationId = "rbxassetid://498281474"
  868. NumberValue24.Name = "CooldownTime"
  869. NumberValue24.Parent = Animation23
  870. NumberValue24.Value = 1
  871. Folder25.Name = "FireCastAnimations"
  872. Folder25.Parent = Script17
  873. Animation26.Name = "BigFireCast"
  874. Animation26.Parent = Folder25
  875. Animation26.AnimationId = "rbxassetid://498346816"
  876. Animation27.Name = "FireShoot"
  877. Animation27.Parent = Folder25
  878. Animation27.AnimationId = "rbxassetid://502043286"
  879. ParticleEmitter28.Name = "FireEffect"
  880. ParticleEmitter28.Parent = Script17
  881. ParticleEmitter28.Speed = NumberRange.new(10, 10)
  882. ParticleEmitter28.Color = ColorSequence.new(Color3.new(1, 0.666667, 0),Color3.new(1, 0.370819, 0),Color3.new(1, 0.333333, 0))
  883. ParticleEmitter28.Enabled = false
  884. ParticleEmitter28.LightEmission = 0.34999999403954
  885. ParticleEmitter28.Texture = "rbxassetid://494864527"
  886. ParticleEmitter28.Transparency = NumberSequence.new(0.50625002384186,0,1)
  887. ParticleEmitter28.Size = NumberSequence.new(0,1.0624998807907,0,0)
  888. ParticleEmitter28.Lifetime = NumberRange.new(0.5, 0.75)
  889. ParticleEmitter28.Rate = 200
  890. ParticleEmitter28.RotSpeed = NumberRange.new(-180, 180)
  891. Script29.Name = "FireballDamage"
  892. Script29.Parent = Script17
  893. table.insert(cors,sandbox(Script29,function()
  894. local sp = script.Parent
  895.  
  896. function damage(p)
  897. if game.Players:FindFirstChild(p.Parent.Name) ~= nil then
  898. if p and p.Parent then
  899. if p.Parent.ClassName ~= "Hat" or p.Parent.ClassName ~= "Tool" then
  900. script.Disabled = true
  901. sp.Anchored = true
  902. sp:findFirstChild("FireEffect"):Destroy()
  903. sp.Transparency = 1
  904. sp:findFirstChild("PointLight"):Destroy()
  905.  
  906. local fire = script.FireEffect
  907. fire.Parent = p.Parent.Torso
  908. fire.Enabled = true
  909. p.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(30,50))
  910. sp:findFirstChild("FireballSound"):clone().Parent = p.Parent.Torso
  911. sp:findFirstChild("FireballSound"):Destroy()
  912. wait(2.5)
  913. fire.Enabled = false
  914. for i = 1, 10 do
  915. if p and p.Parent then
  916. p.Parent.Torso:findFirstChild("FireballSound").Volume = p.Parent.Torso:findFirstChild("FireballSound").Volume - 0.1
  917. wait()
  918. end
  919. end
  920. wait(0.5)
  921. fire:Destroy()
  922. p.Parent.Torso:findFirstChild("FireballSound"):Destroy()
  923. script.Parent:Destroy()
  924. end
  925. end
  926. end
  927. wait(0.025)
  928. end
  929.  
  930.  
  931. script.Parent.Touched:connect(damage)
  932.  
  933. end))
  934. Script29.Disabled = true
  935. ParticleEmitter30.Name = "FireEffect"
  936. ParticleEmitter30.Parent = Script29
  937. ParticleEmitter30.Speed = NumberRange.new(10, 10)
  938. ParticleEmitter30.Color = ColorSequence.new(Color3.new(1, 0.666667, 0),Color3.new(1, 0.370819, 0),Color3.new(1, 0.333333, 0))
  939. ParticleEmitter30.Enabled = false
  940. ParticleEmitter30.LightEmission = 0.34999999403954
  941. ParticleEmitter30.Texture = "rbxassetid://494864527"
  942. ParticleEmitter30.Transparency = NumberSequence.new(0.50625002384186,0,1)
  943. ParticleEmitter30.Size = NumberSequence.new(0,1.0624998807907,0,0)
  944. ParticleEmitter30.Lifetime = NumberRange.new(0.5, 0.75)
  945. ParticleEmitter30.Rate = 200
  946. ParticleEmitter30.RotSpeed = NumberRange.new(-180, 180)
  947. Sound31.Name = "FireballSound"
  948. Sound31.Parent = Script17
  949. Sound31.Looped = true
  950. Sound31.SoundId = "http://www.roblox.com/asset/?id=31760113"
  951. Sound31.Volume = 1
  952. Script32.Name = "BloodScript3"
  953. Script32.Parent = Model0
  954. table.insert(cors,sandbox(Script32,function()
  955. -- This script makes everytime a player dies, blood will come out --
  956.  
  957. function died()
  958. local human = script.Parent:FindFirstChild("Humanoid")
  959. if (human.Health == 0) then
  960. for i = 1,50 do
  961. local torso = script.Parent:FindFirstChild("Torso")
  962. if torso ~= nil then
  963. local blood = Instance.new("Part")
  964. blood.BrickColor = BrickColor.new("Crimson")
  965. blood.Transparency = 1
  966. blood.Size = Vector3.new(1, 0.4, 1)
  967. blood.Position = torso.Position
  968. blood.Name = "Blood"
  969. blood.Reflectance = 0.1
  970. blood.Material = "SmoothPlastic"
  971. blood.BottomSurface = "Smooth"
  972. blood.TopSurface = "Smooth"
  973. blood.Parent = game.Workspace
  974. local billboard = script.BillboardGui:clone()
  975. billboard.Parent = blood
  976. local gui = script.BloodGui:clone()
  977. gui.Parent = billboard
  978. game:GetService("Debris"):AddItem(blood, 12)
  979. end
  980. end
  981. end
  982. end
  983.  
  984. script.Parent.Humanoid.Died:connect(died)
  985.  
  986. end))
  987. BillboardGui33.Parent = Script32
  988. BillboardGui33.Size = UDim2.new(4, 0, 2, 0)
  989. ImageLabel34.Name = "BloodGui"
  990. ImageLabel34.Parent = Script32
  991. ImageLabel34.Size = UDim2.new(1, 0, 1, 0)
  992. ImageLabel34.BackgroundColor = BrickColor.new("Institutional white")
  993. ImageLabel34.BackgroundColor3 = Color3.new(1, 1, 1)
  994. ImageLabel34.BackgroundTransparency = 1
  995. ImageLabel34.Image = "rbxassetid://479898508"
  996. ImageLabel34.ImageColor3 = Color3.new(0.686275, 0, 0)
  997. Script35.Name = "BloodScipt4"
  998. Script35.Parent = Model0
  999. table.insert(cors,sandbox(Script35,function()
  1000. -- This script makes everytime a player get damage, the blood will come out --
  1001.  
  1002. function MakeBlood()
  1003.  
  1004. local blood = Instance.new("Part")
  1005. blood.Size = Vector3.new(1,1,1)
  1006. blood.Name = "Blood"
  1007. blood.Transparency = 1
  1008. blood.BrickColor = BrickColor.new("Crimson")
  1009. blood.CanCollide = false
  1010. blood.BottomSurface = "Smooth"
  1011. blood.TopSurface = "Smooth"
  1012. blood.Material = "SmoothPlastic"
  1013. blood.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  1014. local billboard = script.BillboardGui:Clone()
  1015. billboard.Parent = blood
  1016. local gui = script.BloodGui:Clone()
  1017. gui.Parent = billboard
  1018. game:GetService("Debris"):AddItem(blood, 5)
  1019.  
  1020. local CC = math.random(1,2)
  1021.  
  1022. --[[ if CC == 1 then
  1023.  
  1024. blood.CanCollide = false
  1025.  
  1026. elseif CC == 2 then
  1027.  
  1028. blood.CanCollide = true
  1029.  
  1030. end ]]-- IF YOU WANT YOUR BLOOD TO SOMETIME BE CANCOLLIDE TRUE, THEN REMOVE THE --[[ AND ]]--
  1031. if script.Parent:FindFirstChild("Torso") ~= nil then
  1032. blood.Position = script.Parent.Torso.Position
  1033. blood.Parent = game.Workspace
  1034. end
  1035.  
  1036. end
  1037.  
  1038. human = script.Parent:findFirstChild("Humanoid")
  1039. health = human.Health
  1040.  
  1041. while true do
  1042.  
  1043. if human.Health < health then
  1044.  
  1045. howmuch = math.random(7,20)
  1046. health = human.Health
  1047.  
  1048. for i = 1 , howmuch do
  1049.  
  1050. MakeBlood()
  1051.  
  1052. end
  1053.  
  1054. end
  1055.  
  1056. wait(0.1)
  1057. end
  1058.  
  1059. end))
  1060. BillboardGui36.Parent = Script35
  1061. BillboardGui36.Size = UDim2.new(2, 0, 2, 0)
  1062. ImageLabel37.Name = "BloodGui"
  1063. ImageLabel37.Parent = Script35
  1064. ImageLabel37.Size = UDim2.new(1, 0, 1, 0)
  1065. ImageLabel37.BackgroundColor = BrickColor.new("Institutional white")
  1066. ImageLabel37.BackgroundColor3 = Color3.new(1, 1, 1)
  1067. ImageLabel37.BackgroundTransparency = 1
  1068. ImageLabel37.Image = "rbxassetid://479898508"
  1069. ImageLabel37.ImageColor3 = Color3.new(0.686275, 0, 0)
  1070. Part38.Name = "Left Arm"
  1071. Part38.Parent = Model0
  1072. Part38.CFrame = CFrame.new(-241.898636, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  1073. Part38.Orientation = Vector3.new(0, 180, 0)
  1074. Part38.Position = Vector3.new(-241.898636, 3.5400281, 45.1103287)
  1075. Part38.Rotation = Vector3.new(-180, 0, -180)
  1076. Part38.Color = Color3.new(0.917647, 0.721569, 0.572549)
  1077. Part38.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
  1078. Part38.BottomSurface = Enum.SurfaceType.Smooth
  1079. Part38.BrickColor = BrickColor.new("Light orange")
  1080. Part38.CanCollide = false
  1081. Part38.TopSurface = Enum.SurfaceType.Smooth
  1082. Part38.brickColor = BrickColor.new("Light orange")
  1083. Part38.FormFactor = Enum.FormFactor.Symmetric
  1084. Part38.formFactor = Enum.FormFactor.Symmetric
  1085. Script39.Name = "Animate"
  1086. Script39.Parent = Model0
  1087. table.insert(cors,sandbox(Script39,function()
  1088. function waitForChild(parent, childName)
  1089. local child = parent:findFirstChild(childName)
  1090. if child then return child end
  1091. while true do
  1092. child = parent.ChildAdded:wait()
  1093. if child.Name==childName then return child end
  1094. end
  1095. end
  1096.  
  1097. local Figure = script.Parent
  1098. local Torso = waitForChild(Figure, "Torso")
  1099. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  1100. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  1101. local RightHip = waitForChild(Torso, "Right Hip")
  1102. local LeftHip = waitForChild(Torso, "Left Hip")
  1103. local Neck = waitForChild(Torso, "Neck")
  1104. local Humanoid = waitForChild(Figure, "Humanoid")
  1105. local pose = "Standing"
  1106.  
  1107. local currentAnim = ""
  1108. local currentAnimInstance = nil
  1109. local currentAnimTrack = nil
  1110. local currentAnimKeyframeHandler = nil
  1111. local currentAnimSpeed = 1.0
  1112. local animTable = {}
  1113. local animNames = {
  1114. idle = {
  1115. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  1116. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  1117. },
  1118. walk = {
  1119. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  1120. },
  1121. run = {
  1122. { id = "run.xml", weight = 10 }
  1123. },
  1124. jump = {
  1125. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  1126. },
  1127. fall = {
  1128. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  1129. },
  1130. climb = {
  1131. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  1132. },
  1133. sit = {
  1134. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  1135. },
  1136. toolnone = {
  1137. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  1138. },
  1139. toolslash = {
  1140. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  1141. -- { id = "slash.xml", weight = 10 }
  1142. },
  1143. toollunge = {
  1144. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  1145. },
  1146. wave = {
  1147. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  1148. },
  1149. point = {
  1150. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  1151. },
  1152. dance1 = {
  1153. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  1154. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  1155. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  1156. },
  1157. dance2 = {
  1158. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  1159. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  1160. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  1161. },
  1162. dance3 = {
  1163. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1164. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1165. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1166. },
  1167. laugh = {
  1168. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1169. },
  1170. cheer = {
  1171. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1172. },
  1173. }
  1174. local dances = {"dance1", "dance2", "dance3"}
  1175.  
  1176. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1177. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1178.  
  1179. function configureAnimationSet(name, fileList)
  1180. if (animTable[name] ~= nil) then
  1181. for _, connection in pairs(animTable[name].connections) do
  1182. connection:disconnect()
  1183. end
  1184. end
  1185. animTable[name] = {}
  1186. animTable[name].count = 0
  1187. animTable[name].totalWeight = 0
  1188. animTable[name].connections = {}
  1189.  
  1190. -- check for config values
  1191. local config = script:FindFirstChild(name)
  1192. if (config ~= nil) then
  1193. -- print("Loading anims " .. name)
  1194. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1195. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1196. local idx = 1
  1197. for _, childPart in pairs(config:GetChildren()) do
  1198. if (childPart:IsA("Animation")) then
  1199. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1200. animTable[name][idx] = {}
  1201. animTable[name][idx].anim = childPart
  1202. local weightObject = childPart:FindFirstChild("Weight")
  1203. if (weightObject == nil) then
  1204. animTable[name][idx].weight = 1
  1205. else
  1206. animTable[name][idx].weight = weightObject.Value
  1207. end
  1208. animTable[name].count = animTable[name].count + 1
  1209. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1210. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1211. idx = idx + 1
  1212. end
  1213. end
  1214. end
  1215.  
  1216. -- fallback to defaults
  1217. if (animTable[name].count <= 0) then
  1218. for idx, anim in pairs(fileList) do
  1219. animTable[name][idx] = {}
  1220. animTable[name][idx].anim = Instance.new("Animation")
  1221. animTable[name][idx].anim.Name = name
  1222. animTable[name][idx].anim.AnimationId = anim.id
  1223. animTable[name][idx].weight = anim.weight
  1224. animTable[name].count = animTable[name].count + 1
  1225. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1226. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1227. end
  1228. end
  1229. end
  1230.  
  1231. -- Setup animation objects
  1232. function scriptChildModified(child)
  1233. local fileList = animNames[child.Name]
  1234. if (fileList ~= nil) then
  1235. configureAnimationSet(child.Name, fileList)
  1236. end
  1237. end
  1238.  
  1239. script.ChildAdded:connect(scriptChildModified)
  1240. script.ChildRemoved:connect(scriptChildModified)
  1241.  
  1242.  
  1243. for name, fileList in pairs(animNames) do
  1244. configureAnimationSet(name, fileList)
  1245. end
  1246.  
  1247. -- ANIMATION
  1248.  
  1249. -- declarations
  1250. local toolAnim = "None"
  1251. local toolAnimTime = 0
  1252.  
  1253. local jumpAnimTime = 0
  1254. local jumpAnimDuration = 0.3
  1255.  
  1256. local toolTransitionTime = 0.1
  1257. local fallTransitionTime = 0.3
  1258. local jumpMaxLimbVelocity = 0.75
  1259.  
  1260. -- functions
  1261.  
  1262. function stopAllAnimations()
  1263. local oldAnim = currentAnim
  1264.  
  1265. -- return to idle if finishing an emote
  1266. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1267. oldAnim = "idle"
  1268. end
  1269.  
  1270. currentAnim = ""
  1271. currentAnimInstance = nil
  1272. if (currentAnimKeyframeHandler ~= nil) then
  1273. currentAnimKeyframeHandler:disconnect()
  1274. end
  1275.  
  1276. if (currentAnimTrack ~= nil) then
  1277. currentAnimTrack:Stop()
  1278. currentAnimTrack:Destroy()
  1279. currentAnimTrack = nil
  1280. end
  1281. return oldAnim
  1282. end
  1283.  
  1284. function setAnimationSpeed(speed)
  1285. if speed ~= currentAnimSpeed then
  1286. currentAnimSpeed = speed
  1287. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1288. end
  1289. end
  1290.  
  1291. function keyFrameReachedFunc(frameName)
  1292. if (frameName == "End") then
  1293.  
  1294. local repeatAnim = currentAnim
  1295. -- return to idle if finishing an emote
  1296. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1297. repeatAnim = "idle"
  1298. end
  1299.  
  1300. local animSpeed = currentAnimSpeed
  1301. playAnimation(repeatAnim, 0.0, Humanoid)
  1302. setAnimationSpeed(animSpeed)
  1303. end
  1304. end
  1305.  
  1306. -- Preload animations
  1307. function playAnimation(animName, transitionTime, humanoid)
  1308.  
  1309. local roll = math.random(1, animTable[animName].totalWeight)
  1310. local origRoll = roll
  1311. local idx = 1
  1312. while (roll > animTable[animName][idx].weight) do
  1313. roll = roll - animTable[animName][idx].weight
  1314. idx = idx + 1
  1315. end
  1316. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1317. local anim = animTable[animName][idx].anim
  1318.  
  1319. -- switch animation
  1320. if (anim ~= currentAnimInstance) then
  1321.  
  1322. if (currentAnimTrack ~= nil) then
  1323. currentAnimTrack:Stop(transitionTime)
  1324. currentAnimTrack:Destroy()
  1325. end
  1326.  
  1327. currentAnimSpeed = 1.0
  1328.  
  1329. -- load it to the humanoid; get AnimationTrack
  1330. currentAnimTrack = humanoid:LoadAnimation(anim)
  1331.  
  1332. -- play the animation
  1333. currentAnimTrack:Play(transitionTime)
  1334. currentAnim = animName
  1335. currentAnimInstance = anim
  1336.  
  1337. -- set up keyframe name triggers
  1338. if (currentAnimKeyframeHandler ~= nil) then
  1339. currentAnimKeyframeHandler:disconnect()
  1340. end
  1341. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1342.  
  1343. end
  1344.  
  1345. end
  1346.  
  1347. -------------------------------------------------------------------------------------------
  1348. -------------------------------------------------------------------------------------------
  1349.  
  1350. local toolAnimName = ""
  1351. local toolAnimTrack = nil
  1352. local toolAnimInstance = nil
  1353. local currentToolAnimKeyframeHandler = nil
  1354.  
  1355. function toolKeyFrameReachedFunc(frameName)
  1356. if (frameName == "End") then
  1357. -- print("Keyframe : ".. frameName)
  1358. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1359. end
  1360. end
  1361.  
  1362.  
  1363. function playToolAnimation(animName, transitionTime, humanoid)
  1364.  
  1365. local roll = math.random(1, animTable[animName].totalWeight)
  1366. local origRoll = roll
  1367. local idx = 1
  1368. while (roll > animTable[animName][idx].weight) do
  1369. roll = roll - animTable[animName][idx].weight
  1370. idx = idx + 1
  1371. end
  1372. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1373. local anim = animTable[animName][idx].anim
  1374.  
  1375. if (toolAnimInstance ~= anim) then
  1376.  
  1377. if (toolAnimTrack ~= nil) then
  1378. toolAnimTrack:Stop()
  1379. toolAnimTrack:Destroy()
  1380. transitionTime = 0
  1381. end
  1382.  
  1383. -- load it to the humanoid; get AnimationTrack
  1384. toolAnimTrack = humanoid:LoadAnimation(anim)
  1385.  
  1386. -- play the animation
  1387. toolAnimTrack:Play(transitionTime)
  1388. toolAnimName = animName
  1389. toolAnimInstance = anim
  1390.  
  1391. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1392. end
  1393. end
  1394.  
  1395. function stopToolAnimations()
  1396. local oldAnim = toolAnimName
  1397.  
  1398. if (currentToolAnimKeyframeHandler ~= nil) then
  1399. currentToolAnimKeyframeHandler:disconnect()
  1400. end
  1401.  
  1402. toolAnimName = ""
  1403. toolAnimInstance = nil
  1404. if (toolAnimTrack ~= nil) then
  1405. toolAnimTrack:Stop()
  1406. toolAnimTrack:Destroy()
  1407. toolAnimTrack = nil
  1408. end
  1409.  
  1410.  
  1411. return oldAnim
  1412. end
  1413.  
  1414. -------------------------------------------------------------------------------------------
  1415. -------------------------------------------------------------------------------------------
  1416.  
  1417.  
  1418. function onRunning(speed)
  1419. if speed>0.01 then
  1420. playAnimation("walk", 0.1, Humanoid)
  1421. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1422. setAnimationSpeed(speed / 14.5)
  1423. end
  1424. pose = "Running"
  1425. else
  1426. playAnimation("idle", 0.1, Humanoid)
  1427. pose = "Standing"
  1428. end
  1429. end
  1430.  
  1431. function onDied()
  1432. pose = "Dead"
  1433. end
  1434.  
  1435. function onJumping()
  1436. playAnimation("jump", 0.1, Humanoid)
  1437. jumpAnimTime = jumpAnimDuration
  1438. pose = "Jumping"
  1439. end
  1440.  
  1441. function onClimbing(speed)
  1442. playAnimation("climb", 0.1, Humanoid)
  1443. setAnimationSpeed(speed / 12.0)
  1444. pose = "Climbing"
  1445. end
  1446.  
  1447. function onGettingUp()
  1448. pose = "GettingUp"
  1449. end
  1450.  
  1451. function onFreeFall()
  1452. if (jumpAnimTime <= 0) then
  1453. playAnimation("fall", fallTransitionTime, Humanoid)
  1454. end
  1455. pose = "FreeFall"
  1456. end
  1457.  
  1458. function onFallingDown()
  1459. pose = "FallingDown"
  1460. end
  1461.  
  1462. function onSeated()
  1463. pose = "Seated"
  1464. end
  1465.  
  1466. function onPlatformStanding()
  1467. pose = "PlatformStanding"
  1468. end
  1469.  
  1470. function onSwimming(speed)
  1471. if speed>0 then
  1472. pose = "Running"
  1473. else
  1474. pose = "Standing"
  1475. end
  1476. end
  1477.  
  1478. function getTool()
  1479. for _, kid in ipairs(Figure:GetChildren()) do
  1480. if kid.className == "Tool" then return kid end
  1481. end
  1482. return nil
  1483. end
  1484.  
  1485. function getToolAnim(tool)
  1486. for _, c in ipairs(tool:GetChildren()) do
  1487. if c.Name == "toolanim" and c.className == "StringValue" then
  1488. return c
  1489. end
  1490. end
  1491. return nil
  1492. end
  1493.  
  1494. function animateTool()
  1495.  
  1496. if (toolAnim == "None") then
  1497. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1498. return
  1499. end
  1500.  
  1501. if (toolAnim == "Slash") then
  1502. playToolAnimation("toolslash", 0, Humanoid)
  1503. return
  1504. end
  1505.  
  1506. if (toolAnim == "Lunge") then
  1507. playToolAnimation("toollunge", 0, Humanoid)
  1508. return
  1509. end
  1510. end
  1511.  
  1512. function moveSit()
  1513. RightShoulder.MaxVelocity = 0.15
  1514. LeftShoulder.MaxVelocity = 0.15
  1515. RightShoulder:SetDesiredAngle(3.14 /2)
  1516. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1517. RightHip:SetDesiredAngle(3.14 /2)
  1518. LeftHip:SetDesiredAngle(-3.14 /2)
  1519. end
  1520.  
  1521. local lastTick = 0
  1522.  
  1523. function move(time)
  1524. local amplitude = 1
  1525. local frequency = 1
  1526. local deltaTime = time - lastTick
  1527. lastTick = time
  1528.  
  1529. local climbFudge = 0
  1530. local setAngles = false
  1531.  
  1532. if (jumpAnimTime > 0) then
  1533. jumpAnimTime = jumpAnimTime - deltaTime
  1534. end
  1535.  
  1536. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1537. playAnimation("fall", fallTransitionTime, Humanoid)
  1538. elseif (pose == "Seated") then
  1539. playAnimation("sit", 0.5, Humanoid)
  1540. return
  1541. elseif (pose == "Running") then
  1542. playAnimation("walk", 0.1, Humanoid)
  1543. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1544. -- print("Wha " .. pose)
  1545. stopAllAnimations()
  1546. amplitude = 0.1
  1547. frequency = 1
  1548. setAngles = true
  1549. end
  1550.  
  1551. if (setAngles) then
  1552. desiredAngle = amplitude * math.sin(time * frequency)
  1553.  
  1554. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1555. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1556. RightHip:SetDesiredAngle(-desiredAngle)
  1557. LeftHip:SetDesiredAngle(-desiredAngle)
  1558. end
  1559.  
  1560. -- Tool Animation handling
  1561. local tool = getTool()
  1562. if tool and tool:FindFirstChild("Handle") then
  1563.  
  1564. animStringValueObject = getToolAnim(tool)
  1565.  
  1566. if animStringValueObject then
  1567. toolAnim = animStringValueObject.Value
  1568. -- message recieved, delete StringValue
  1569. animStringValueObject.Parent = nil
  1570. toolAnimTime = time + .3
  1571. end
  1572.  
  1573. if time > toolAnimTime then
  1574. toolAnimTime = 0
  1575. toolAnim = "None"
  1576. end
  1577.  
  1578. animateTool()
  1579. else
  1580. stopToolAnimations()
  1581. toolAnim = "None"
  1582. toolAnimInstance = nil
  1583. toolAnimTime = 0
  1584. end
  1585. end
  1586.  
  1587. -- connect events
  1588. Humanoid.Died:connect(onDied)
  1589. Humanoid.Running:connect(onRunning)
  1590. Humanoid.Jumping:connect(onJumping)
  1591. Humanoid.Climbing:connect(onClimbing)
  1592. Humanoid.GettingUp:connect(onGettingUp)
  1593. Humanoid.FreeFalling:connect(onFreeFall)
  1594. Humanoid.FallingDown:connect(onFallingDown)
  1595. Humanoid.Seated:connect(onSeated)
  1596. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1597. Humanoid.Swimming:connect(onSwimming)
  1598.  
  1599. -- setup emote chat hook (not nessessary)
  1600. --[[game.Players.LocalPlayer.Chatted:connect(function(msg)
  1601. local emote = ""
  1602. if msg == "/e dance" then
  1603. emote = dances[math.random(1, #dances)]
  1604. elseif (string.sub(msg, 1, 3) == "/e ") then
  1605. emote = string.sub(msg, 4)
  1606. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1607. emote = string.sub(msg, 8)
  1608. end
  1609.  
  1610. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1611. playAnimation(emote, 0.1, Humanoid)
  1612. end
  1613.  
  1614. end)]]--
  1615.  
  1616.  
  1617. -- main program
  1618.  
  1619. local runService = game:service("RunService");
  1620.  
  1621. -- initialize to idle
  1622. playAnimation("idle", 0.1, Humanoid)
  1623. pose = "Standing"
  1624.  
  1625. while Figure.Parent~=nil do
  1626. local _, time = wait(0.1)
  1627. move(time)
  1628. end
  1629.  
  1630.  
  1631.  
  1632. end))
  1633. StringValue40.Name = "climb"
  1634. StringValue40.Parent = Script39
  1635. Animation41.Name = "ClimbAnim"
  1636. Animation41.Parent = StringValue40
  1637. Animation41.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1638. StringValue42.Name = "fall"
  1639. StringValue42.Parent = Script39
  1640. Animation43.Name = "FallAnim"
  1641. Animation43.Parent = StringValue42
  1642. Animation43.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1643. StringValue44.Name = "idle"
  1644. StringValue44.Parent = Script39
  1645. Animation45.Name = "Animation1"
  1646. Animation45.Parent = StringValue44
  1647. Animation45.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1648. NumberValue46.Name = "Weight"
  1649. NumberValue46.Parent = Animation45
  1650. NumberValue46.Value = 9
  1651. Animation47.Name = "Animation2"
  1652. Animation47.Parent = StringValue44
  1653. Animation47.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1654. NumberValue48.Name = "Weight"
  1655. NumberValue48.Parent = Animation47
  1656. NumberValue48.Value = 1
  1657. StringValue49.Name = "jump"
  1658. StringValue49.Parent = Script39
  1659. Animation50.Name = "JumpAnim"
  1660. Animation50.Parent = StringValue49
  1661. Animation50.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1662. StringValue51.Name = "run"
  1663. StringValue51.Parent = Script39
  1664. Animation52.Name = "RunAnim"
  1665. Animation52.Parent = StringValue51
  1666. Animation52.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1667. StringValue53.Name = "sit"
  1668. StringValue53.Parent = Script39
  1669. Animation54.Name = "SitAnim"
  1670. Animation54.Parent = StringValue53
  1671. Animation54.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1672. StringValue55.Name = "toolnone"
  1673. StringValue55.Parent = Script39
  1674. Animation56.Name = "ToolNoneAnim"
  1675. Animation56.Parent = StringValue55
  1676. Animation56.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1677. StringValue57.Name = "walk"
  1678. StringValue57.Parent = Script39
  1679. Animation58.Name = "WalkAnim"
  1680. Animation58.Parent = StringValue57
  1681. Animation58.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1682. Script59.Name = "BattleNPC (NEW)"
  1683. Script59.Parent = Model0
  1684. table.insert(cors,sandbox(Script59,function()
  1685. wait(1)
  1686. --------------------- VARIABLES ---------------------------
  1687.  
  1688. local npc = script.Parent
  1689. local torso = npc.Torso
  1690. local hum = npc:findFirstChild("Humanoid")
  1691. local humrootpart = npc.HumanoidRootPart
  1692. local target = npc.TargetTo
  1693.  
  1694. local debounce = false
  1695. local punching = false
  1696. --local walkcount = 0
  1697.  
  1698.  
  1699. local SpecialMoves = {
  1700. "ShootFireball",
  1701. "BlastFireball",
  1702. "SpeedBoost",
  1703. "Shockwave",
  1704. "Fly",
  1705. "Abyss Power"
  1706. }
  1707.  
  1708.  
  1709.  
  1710.  
  1711. --------------------- FUNCTIONS ---------------------------
  1712.  
  1713. local larm = script.Parent:FindFirstChild("Left Arm")
  1714. local rarm = script.Parent:FindFirstChild("Right Arm")
  1715. function findNearestTorso(pos)
  1716. local list = game.Workspace:children()
  1717. local torso = nil
  1718. local dist = 100 -- distance to find a humanoid (player)
  1719. local temp = nil
  1720. local human = nil
  1721. local temp2 = nil
  1722. for x = 1, #list do
  1723. temp2 = list[x]
  1724. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  1725. temp = temp2:findFirstChild("Torso")
  1726. human = temp2:findFirstChild("Humanoid")
  1727. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  1728. if (temp.Position - pos.Position).magnitude < dist then
  1729. torso = temp
  1730. dist = (temp.Position - pos.Position).magnitude
  1731. end
  1732. end
  1733. end
  1734. end
  1735. return torso
  1736. end
  1737.  
  1738.  
  1739.  
  1740. function shootfireball()
  1741. local debounce = false
  1742. wait(0.6)
  1743. local part = Instance.new("Part")
  1744. part.Name = "Fireball"
  1745. part.TopSurface = "Smooth"
  1746. part.BottomSurface = "Smooth"
  1747. part.Shape = "Ball"
  1748. part.Size = Vector3.new(2,2,2)
  1749. part.BrickColor = BrickColor.new("Neon orange")
  1750. part.CanCollide = false
  1751. part.Transparency = 0.3
  1752. game.Debris:AddItem(part, 6)
  1753.  
  1754. local fire = script.FireEffect:Clone()
  1755. fire.Enabled = true
  1756. fire.Parent = part
  1757.  
  1758. local light = Instance.new("PointLight", part)
  1759. light.Color = Color3.new(255, 205, 0)
  1760. light.Range = 8
  1761.  
  1762. local sound = script.FireballSound:Clone()
  1763. sound.Parent = part
  1764. sound:Play()
  1765.  
  1766. local velocity = Instance.new("BodyVelocity", part)
  1767. velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  1768. velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  1769. part.Parent = game.Workspace
  1770. part.CFrame = npc.Torso.CFrame * CFrame.new(2, 0, 0)
  1771.  
  1772. local damagescript = script.FireballDamage:Clone()
  1773. damagescript.Parent = part
  1774. damagescript.Disabled = false
  1775.  
  1776. local tag = Instance.new("ObjectValue", part)
  1777. tag.Name = "creator"
  1778. tag.Value = npc
  1779.  
  1780. part.Parent = game.Workspace
  1781.  
  1782. wait(0.4) -----------------------------------------------------------------
  1783.  
  1784. local part2 = Instance.new("Part")
  1785. part2.Name = "Fireball"
  1786. part2.TopSurface = "Smooth"
  1787. part2.BottomSurface = "Smooth"
  1788. part2.Shape = "Ball"
  1789. part2.Size = Vector3.new(2,2,2)
  1790. part2.BrickColor = BrickColor.new("Neon orange")
  1791. part2.CanCollide = false
  1792. part2.Transparency = 0.3
  1793. game.Debris:AddItem(part, 6)
  1794.  
  1795. local fire2 = script.FireEffect:Clone()
  1796. fire2.Enabled = true
  1797. fire2.Parent = part2
  1798.  
  1799. local light2 = Instance.new("PointLight", part2)
  1800. light2.Color = Color3.new(255, 205, 0)
  1801. light2.Range = 8
  1802.  
  1803. local sound2 = script.FireballSound:Clone()
  1804. sound2.Parent = part2
  1805. sound2:Play()
  1806.  
  1807. local velocity2 = Instance.new("BodyVelocity", part2)
  1808. velocity2.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  1809. velocity2.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  1810. part2.CFrame = npc.Torso.CFrame * CFrame.new(-2, 0, 0)
  1811.  
  1812. local damagescript2 = script.FireballDamage:Clone()
  1813. damagescript2.Parent = part2
  1814. damagescript2.Disabled = false
  1815.  
  1816. local tag2 = Instance.new("ObjectValue", part2)
  1817. tag2.Name = "creator"
  1818. tag2.Value = npc
  1819.  
  1820. part2.Parent = game.Workspace
  1821. end
  1822.  
  1823.  
  1824.  
  1825. function blastfireball()
  1826. local debounce = false
  1827. wait(1.2)
  1828. --shoot fireball
  1829. local part = Instance.new("Part")
  1830. part.Name = "BigFireball"
  1831. part.TopSurface = "Smooth"
  1832. part.BottomSurface = "Smooth"
  1833. part.Shape = "Ball"
  1834. part.Size = Vector3.new(3.5, 3.5, 3.5)
  1835. part.BrickColor = BrickColor.new("Neon orange")
  1836. part.CanCollide = false
  1837. part.Transparency = 0.3
  1838. game.Debris:AddItem(part, 6)
  1839.  
  1840. local fire = script.FireEffect:Clone()
  1841. fire.Enabled = true
  1842. fire.Parent = part
  1843.  
  1844. local light = Instance.new("PointLight")
  1845. light.Color = Color3.new(255, 205, 0)
  1846. light.Range = 10
  1847. light.Parent = part
  1848.  
  1849. local velocity = Instance.new("BodyVelocity", part)
  1850. velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
  1851. velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  1852. part.CFrame = npc.Torso.CFrame * CFrame.new(0, 0, -5)
  1853.  
  1854. local sound = script.FireballSound:clone()
  1855. sound.Parent = part
  1856. sound:Play()
  1857.  
  1858. local damagescript = script.FireballDamage:Clone()
  1859. damagescript.Parent = part
  1860. damagescript.Disabled = false
  1861.  
  1862. local tag = Instance.new("ObjectValue", part)
  1863. tag.Name = "creator"
  1864. tag.Value = npc
  1865.  
  1866. part.Parent = game.Workspace
  1867. end
  1868.  
  1869.  
  1870.  
  1871. function speedboost()
  1872. local part = Instance.new("Part", game.Workspace)
  1873. part.Name = "RadiusEffect"
  1874. part.Shape = "Ball"
  1875. part.CanCollide = false
  1876. part.BrickColor = BrickColor.new("Institutional white")
  1877. part.Size = Vector3.new(3,3,3)
  1878. part.Anchored = true
  1879. part.TopSurface = "Smooth"
  1880. part.BottomSurface = "Smooth"
  1881. part.Transparency = 0.1
  1882. part.CFrame = npc:findFirstChild("Torso").CFrame
  1883. game.Debris:AddItem(part, 3)
  1884. hum.WalkSpeed = hum.WalkSpeed * 1.5
  1885. for i = 1, 25 do --animate the ball
  1886. part.Size = part.Size + Vector3.new(0.5,0.5,0.5)
  1887. part.Transparency = part.Transparency + 0.04
  1888. part.CFrame = torso.CFrame
  1889. wait()
  1890. end
  1891. wait(5)
  1892. hum.WalkSpeed = hum.WalkSpeed / 1.5
  1893. end
  1894.  
  1895.  
  1896.  
  1897.  
  1898. function createshockwave()
  1899. local torso = hum.Torso
  1900.  
  1901. wait(0.8)
  1902. local sampleblock = Instance.new("Part", game.Workspace)
  1903. sampleblock.Name = "VelocityGuider"
  1904. sampleblock.CanCollide = false
  1905. sampleblock.Size = Vector3.new(1,1,1)
  1906. sampleblock.Transparency = 1
  1907. sampleblock.CFrame = torso.CFrame * CFrame.new(0,-1,0)
  1908. game.Debris:AddItem(sampleblock, 6)
  1909. local velocity = Instance.new("BodyVelocity", sampleblock)
  1910. velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  1911. velocity.velocity = torso.CFrame.lookVector * 100
  1912.  
  1913. local group = Instance.new("Model", game.Workspace)
  1914. group.Name = "ShockwaveEffects"
  1915. game.Debris:AddItem(group, 10)
  1916. spawn(function()
  1917. for i = 1,25 do
  1918. if sampleblock ~= nil then
  1919. sampleblock.CFrame = CFrame.new(sampleblock.CFrame.X, torso.CFrame.Y, sampleblock.CFrame.Z)
  1920.  
  1921. local blastblock = Instance.new("Part", group)
  1922. blastblock.Name = "Shockwave"
  1923. blastblock.Anchored = true
  1924. blastblock.CanCollide = false
  1925. blastblock.BrickColor = BrickColor.new("Neon orange")
  1926. blastblock.TopSurface = "Smooth"
  1927. blastblock.BottomSurface = "Smooth"
  1928. blastblock.Transparency = 1
  1929. blastblock.Size = Vector3.new(12,6,12)
  1930. blastblock.CFrame = sampleblock.CFrame * CFrame.Angles(0 , math.rad(math.random(-180,180)) , 0)
  1931. game.Debris:AddItem(blastblock, 6)
  1932.  
  1933. local mesh = Instance.new("SpecialMesh", blastblock)
  1934. mesh.Name = "BlastMesh"
  1935. mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  1936. mesh.Scale = Vector3.new(0,0,0) --blastblock.Size
  1937.  
  1938. spawn(function()
  1939. for i = 1,9 do
  1940. blastblock.Transparency = blastblock.Transparency - 0.1111111111111111111111111111
  1941. mesh.Scale = mesh.Scale + Vector3.new(1.333333333333333333, 0.666666666666666, 1.333333333333333333)
  1942. wait()
  1943. end
  1944. end)
  1945.  
  1946. local newboom = script.SmallBoom:Clone()
  1947. newboom.Parent = sampleblock
  1948. newboom:Play()
  1949.  
  1950. local shockwavedamage = script.ShockwaveDamage:Clone()
  1951. shockwavedamage.Parent = blastblock
  1952. shockwavedamage.Disabled = false
  1953.  
  1954. local tag = Instance.new("ObjectValue", blastblock)
  1955. tag.Name = "creator"
  1956. tag.Value = npc
  1957.  
  1958. delay(0.5, function()
  1959. for i = 1,20 do
  1960. blastblock.Transparency = blastblock.Transparency + 0.05
  1961. mesh.Scale = mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  1962. wait()
  1963. end
  1964. end)
  1965. wait(0.2)
  1966. end
  1967. end
  1968. end)
  1969. end
  1970.  
  1971.  
  1972.  
  1973.  
  1974. function fly()
  1975. if torso and hum and hum.Health > 0 then
  1976. local anim = script.SpecialAnimations.Fly
  1977. local animtrack = hum:LoadAnimation(anim)
  1978. animtrack:Play()
  1979. local targettorso = findNearestTorso(torso)
  1980. if targettorso then
  1981. local bp = Instance.new("BodyPosition", torso)
  1982. bp.MaxForce = Vector3.new(400000,400000,400000)
  1983.  
  1984. local randomtime = math.random(30,100)
  1985. for i = 1, randomtime do
  1986. bp.Position = (CFrame.new(targettorso.Position)*CFrame.Angles(0,math.pi*2*((tick()/5)%1),0)*CFrame.new(15,15,0)).p
  1987. wait()
  1988. end
  1989.  
  1990. animtrack:Stop()
  1991. bp:Destroy()
  1992. end
  1993. end
  1994. end
  1995.  
  1996.  
  1997.  
  1998. function abysspower()
  1999. wait(1)
  2000. if torso and hum and hum.Health > 0 and humrootpart then
  2001.  
  2002. spawn(function()
  2003. for i = 1,5 do
  2004. local ring = Instance.new("Part", game.Workspace)
  2005. ring.Name = "ForceFieldRing"
  2006. ring.BrickColor = BrickColor.Red()
  2007. ring.Size = Vector3.new(8,8,10)
  2008. ring.CanCollide = false
  2009. ring.Anchored = true
  2010. ring.TopSurface = "Smooth"
  2011. ring.BottomSurface = "Smooth"
  2012. ring.Transparency = 0.7
  2013. ring.CFrame = torso.CFrame
  2014. game.Debris:AddItem(ring, 30)
  2015. local mesh = Instance.new("SpecialMesh", ring)
  2016. mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  2017. mesh.Scale = Vector3.new(10, 10, 50)
  2018. spawn(function()
  2019. while true do
  2020. ring.CFrame = torso.CFrame * CFrame.Angles(math.rad(math.random(-180,180)) , math.rad(math.random(-180,180)) , math.rad(math.random(-180,180)))
  2021. wait()
  2022. end
  2023. end)
  2024. end
  2025. end)
  2026.  
  2027. local penta = Instance.new("Part", game.Workspace)
  2028. penta.Name = "Pentagram"
  2029. penta.TopSurface = "Smooth"
  2030. penta.BottomSurface = "Smooth"
  2031. penta.Transparency = 1
  2032. penta.CanCollide = false
  2033. penta.Anchored = true
  2034. penta.Size = Vector3.new(0,0.2,0)
  2035. penta.CFrame = humrootpart.CFrame + Vector3.new(0, -4.4, 0)
  2036. local decal = Instance.new("Decal", penta)
  2037. decal.Face = "Top"
  2038. decal.Texture = "http://www.roblox.com/asset/?id=950330730"
  2039.  
  2040. for i = 1, 50 do
  2041. penta.Size = penta.Size + Vector3.new(1,0,1)
  2042. local pentaRot = penta.CFrame - penta.CFrame.p
  2043. penta.CFrame = humrootpart.CFrame * CFrame.new(0, -4.4, 0) * pentaRot * CFrame.fromEulerAnglesXYZ(0,math.rad(10),0)
  2044. wait()
  2045. end
  2046.  
  2047. wait(5)
  2048. local group = Instance.new("Model", game.Workspace)
  2049. group.Name = "Holes"
  2050.  
  2051. spawn(function()
  2052. for i = 1, 100 do
  2053. local hole = Instance.new("Part", group)
  2054. hole.Name = "Hole"
  2055. hole.CanCollide = false
  2056. hole.Anchored = true
  2057. hole.Transparency = 1
  2058. hole.Size = Vector3.new(0,0.2,0)
  2059. hole.CFrame = humrootpart.CFrame * CFrame.new(math.random(-300,300), -2.75, math.random(-300,300)) * CFrame.Angles(0, math.rad(math.random(-180,180)), 0)
  2060. local decal = Instance.new("Decal", hole)
  2061. decal.Face = "Top"
  2062. decal.Texture = "http://www.roblox.com/asset/?id=963051270"
  2063. local sound = script.HoleCrack:Clone()
  2064. local randompitch = math.random(8,20)
  2065. randompitch = randompitch / 10
  2066. sound.Parent = hole
  2067. sound.Pitch = randompitch
  2068. sound:Play()
  2069. local lavascript = script.LavaScript:Clone()
  2070. lavascript.Parent = hole
  2071. lavascript.Disabled = false
  2072. local tag = Instance.new("ObjectValue", hole)
  2073. tag.Name = "creator"
  2074. tag.Value = npc
  2075.  
  2076. local currentpos = hole.CFrame
  2077. spawn(function()
  2078. for i = 1,25 do
  2079. hole.Size = hole.Size + Vector3.new(5, 0, 5)
  2080. hole.CFrame = currentpos
  2081. wait()
  2082. end
  2083. end)
  2084. wait(math.random(0, 0.5))
  2085. end
  2086. end)
  2087. wait(20)
  2088. group:Destroy()
  2089. penta:Destroy()
  2090.  
  2091. end
  2092. end
  2093.  
  2094.  
  2095. -------------------------------- MAIN SCRIPTS ------------------------------------
  2096.  
  2097. function chase()
  2098. while true do
  2099. local targettorso = findNearestTorso(torso)
  2100. if targettorso and hum.Health > 0 then
  2101. for walkcount = 1,20 do
  2102. if punching == false then
  2103. hum:MoveTo(targettorso.Position, targettorso)
  2104. end
  2105.  
  2106. if walkcount == 10 then
  2107. local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
  2108. if ChosenAttack == "ShootFireball" then
  2109. hum:LoadAnimation(script.SpecialAnimations.FireShoot):Play()
  2110. shootfireball()
  2111. end ----------------------------
  2112. if ChosenAttack == "BlastFireball" then
  2113. hum:LoadAnimation(script.SpecialAnimations.BigFireCast):Play()
  2114. blastfireball()
  2115. end
  2116. if ChosenAttack == "SpeedBoost" then
  2117. spawn(speedboost)
  2118. end
  2119. if ChosenAttack == "Shockwave" then
  2120. hum:LoadAnimation(script.SpecialAnimations.ShockwavePunch):Play()
  2121. createshockwave()
  2122. end
  2123. if ChosenAttack == "Fly" then
  2124. fly()
  2125. end
  2126. if ChosenAttack == "Abyss Power" then
  2127. local chance = math.random(1,5)
  2128. if chance == 1 then
  2129. punching = true
  2130. local oldwalkspeed = hum.WalkSpeed
  2131. hum.WalkSpeed = 0
  2132. hum:LoadAnimation(script.SpecialAnimations.UltimatePower):Play()
  2133. abysspower() -- cannot use spawn()
  2134. hum.WalkSpeed = oldwalkspeed
  2135. punching = false
  2136. end
  2137. end
  2138. end
  2139.  
  2140. wait(0.1)
  2141. end
  2142. end
  2143. wait(math.random(0.1, 1))
  2144. end
  2145. end
  2146.  
  2147.  
  2148. --[[function chase(OLD)
  2149. while true do
  2150. function scan(p)
  2151. for _,target in pairs(p:GetChildren()) do
  2152. if target and target.Parent and target.Parent:FindFirstChild("Humanoid") ~= nil then
  2153. local char = target.Parent
  2154. local targethum = char:FindFirstChild("Humanoid")
  2155. local targettorso = char:FindFirstChild("Torso")
  2156. if targettorso and targethum and targethum.Health > 0 then
  2157. if (targettorso.Position - torso.Position).magnitude <= 100 then
  2158.  
  2159. for walkcount = 1,20 do
  2160. print(walkcount)
  2161. hum:MoveTo(targettorso.Position, targettorso)
  2162.  
  2163. if walkcount == 10 then
  2164. local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
  2165. if ChosenAttack == "ShootFireball" then
  2166. hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
  2167. shootfireball()
  2168. end ----------------------------
  2169. if ChosenAttack == "BlastFireball" then
  2170. hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
  2171. blastfireball()
  2172. end
  2173. if ChosenAttack == "SpeedBoost" then
  2174. spawn(speedboost)
  2175. end
  2176. end
  2177.  
  2178. wait()
  2179. end
  2180.  
  2181. end
  2182. end
  2183. end
  2184. scan(target)
  2185. end
  2186. end
  2187. scan(game.Workspace)
  2188. wait()
  2189. end
  2190. end]]--
  2191.  
  2192. --[[function chase(EVEN OLDER)
  2193. if hum.Health > 0 then
  2194. if p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil then
  2195. debounce = true
  2196. target.Value = p.Parent.Name
  2197. for chance = 1, 20 do
  2198. if debounce == true then --set to false if you don't want it to range attack
  2199. walkcount = walkcount + 1
  2200. end
  2201.  
  2202. if walkcount == 10 then
  2203. local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
  2204. if ChosenAttack == "ShootFireball" then
  2205. hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
  2206. shootfireball()
  2207. end ----------------------------
  2208. if ChosenAttack == "BlastFireball" then
  2209. hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
  2210. blastfireball()
  2211. end
  2212. if ChosenAttack == "SpeedBoost" then
  2213. speedboost()
  2214. hum.WalkSpeed = 16.5 --humanoid speed
  2215. wait(5)
  2216. hum.WalkSpeed = 12 --original speed
  2217. end
  2218. end
  2219.  
  2220. if punching == false then
  2221. if p and p.Parent then
  2222. hum:MoveTo(p.Parent.Torso.Position, p.Parent.Torso)
  2223. end
  2224. end
  2225. wait(0.1)
  2226. end
  2227. walkcount = 0
  2228. end
  2229. end
  2230. end]]--
  2231.  
  2232.  
  2233.  
  2234. function attack(p)
  2235. if hum.Health > 0 then
  2236. if punching == false and p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil and p.Parent:findFirstChild("Humanoid").Health > 0 then
  2237. local victim = p.Parent
  2238. victim.Humanoid:TakeDamage(math.random(10, 15))
  2239. --victim.Humanoid.Sit = true
  2240. --add velocity or something
  2241. victim.Torso.Velocity = torso.CFrame.lookVector * 50 + Vector3.new(0, 25, 0)
  2242. punching = true
  2243. local attackanimations = script.AttackAnimations:GetChildren()
  2244. local chosenAnim = attackanimations[math.random(1, #attackanimations)]
  2245. hum:LoadAnimation(chosenAnim):Play()
  2246. wait(1)
  2247. punching = false
  2248. end
  2249. end
  2250. end
  2251.  
  2252. spawn(chase)
  2253. torso.Touched:connect(attack)
  2254.  
  2255.  
  2256.  
  2257.  
  2258. end))
  2259. Folder60.Name = "AttackAnimations"
  2260. Folder60.Parent = Script59
  2261. Animation61.Name = "AttackAnim2"
  2262. Animation61.Parent = Folder60
  2263. Animation61.AnimationId = "rbxassetid://498292433"
  2264. NumberValue62.Name = "CooldownTime"
  2265. NumberValue62.Parent = Animation61
  2266. NumberValue62.Value = 0.8
  2267. Animation63.Name = "AttackAnim3"
  2268. Animation63.Parent = Folder60
  2269. Animation63.AnimationId = "rbxassetid://501476461"
  2270. NumberValue64.Name = "CooldownTime"
  2271. NumberValue64.Parent = Animation63
  2272. NumberValue64.Value = 1
  2273. Animation65.Name = "AttackAnim1"
  2274. Animation65.Parent = Folder60
  2275. Animation65.AnimationId = "rbxassetid://498281474"
  2276. NumberValue66.Name = "CooldownTime"
  2277. NumberValue66.Parent = Animation65
  2278. NumberValue66.Value = 1
  2279. Folder67.Name = "SpecialAnimations"
  2280. Folder67.Parent = Script59
  2281. Animation68.Name = "BigFireCast"
  2282. Animation68.Parent = Folder67
  2283. Animation68.AnimationId = "rbxassetid://498346816"
  2284. Animation69.Name = "FireShoot"
  2285. Animation69.Parent = Folder67
  2286. Animation69.AnimationId = "rbxassetid://502043286"
  2287. Animation70.Name = "ShockwavePunch"
  2288. Animation70.Parent = Folder67
  2289. Animation70.AnimationId = "rbxassetid://962368558"
  2290. Animation71.Name = "Fly"
  2291. Animation71.Parent = Folder67
  2292. Animation71.AnimationId = "rbxassetid://962638887"
  2293. Animation72.Name = "UltimatePower"
  2294. Animation72.Parent = Folder67
  2295. Animation72.AnimationId = "rbxassetid://963022822"
  2296. ParticleEmitter73.Name = "FireEffect"
  2297. ParticleEmitter73.Parent = Script59
  2298. ParticleEmitter73.Speed = NumberRange.new(10, 10)
  2299. ParticleEmitter73.Color = ColorSequence.new(Color3.new(1, 0.333333, 0),Color3.new(1, 0.666667, 0))
  2300. ParticleEmitter73.Enabled = false
  2301. ParticleEmitter73.LightEmission = 0.34999999403954
  2302. ParticleEmitter73.Texture = "rbxassetid://494864527"
  2303. ParticleEmitter73.Transparency = NumberSequence.new(0.50625002384186,0,1)
  2304. ParticleEmitter73.Size = NumberSequence.new(0,1.0624998807907,0,0)
  2305. ParticleEmitter73.Lifetime = NumberRange.new(0.5, 0.75)
  2306. ParticleEmitter73.Rate = 200
  2307. ParticleEmitter73.RotSpeed = NumberRange.new(-180, 180)
  2308. Script74.Name = "FireballDamage"
  2309. Script74.Parent = Script59
  2310. table.insert(cors,sandbox(Script74,function()
  2311. local sp = script.Parent
  2312. local creator = sp:WaitForChild("creator")
  2313.  
  2314. --[[function damage(p)
  2315. if game.Players:FindFirstChild(p.Parent.Name) ~= nil then
  2316. if p and p.Parent then
  2317. if p.Name ~= "Handle" then
  2318. script.Disabled = true
  2319. sp.Anchored = true
  2320. sp:FindFirstChild("FireEffect"):Destroy()
  2321. sp.Transparency = 1
  2322. sp:FindFirstChild("PointLight"):Destroy()
  2323.  
  2324. local fire = script.FireEffect
  2325. fire.Parent = p.Parent.Torso
  2326. fire.Enabled = true
  2327. p.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(30,50))
  2328. sp:findFirstChild("FireballSound"):clone().Parent = p.Parent.Torso
  2329. sp:findFirstChild("FireballSound"):Destroy()
  2330. wait(2.5)
  2331. fire.Enabled = false
  2332. for i = 1, 10 do
  2333. if p and p.Parent then
  2334. p.Parent.Torso:findFirstChild("FireballSound").Volume = p.Parent.Torso:findFirstChild("FireballSound").Volume - 0.1
  2335. wait()
  2336. end
  2337. end
  2338. wait(0.5)
  2339. fire:Destroy()
  2340. p.Parent.Torso:findFirstChild("FireballSound"):Destroy()
  2341. script.Parent:Destroy()
  2342. end
  2343. end
  2344. end
  2345. wait(0.025)
  2346. end]]--
  2347.  
  2348.  
  2349. function damage(p)
  2350. if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(creator.Value) then
  2351. local hum = p.Parent:FindFirstChild("Humanoid")
  2352. local torso = p.Parent:FindFirstChild("Torso")
  2353. -- damage the player
  2354. if sp.Name == "Fireball" then
  2355. hum:TakeDamage(math.random(10,20))
  2356. elseif sp.Name == "BigFireball" then
  2357. hum:TakeDamage(math.random(20,40))
  2358. end
  2359. -- make decorations and realism
  2360. sp.Transparency = 1
  2361. sp.Anchored = true
  2362.  
  2363. local newsound = sp.FireballSound:Clone()
  2364. newsound.Parent = torso
  2365. newsound:Play()
  2366. game.Debris:AddItem(newsound, 5)
  2367. sp.FireballSound:remove()
  2368.  
  2369. local neweffect = sp.FireEffect:Clone()
  2370. neweffect.Parent = torso
  2371. game.Debris:AddItem(neweffect, 5)
  2372. sp.FireEffect:remove()
  2373.  
  2374. sp:Destroy()
  2375. end
  2376. end
  2377.  
  2378.  
  2379. script.Parent.Touched:connect(damage)
  2380.  
  2381. end))
  2382. Script74.Disabled = true
  2383. Sound75.Name = "FireballSound"
  2384. Sound75.Parent = Script59
  2385. Sound75.Looped = true
  2386. Sound75.SoundId = "http://www.roblox.com/asset/?id=31760113"
  2387. Sound75.Volume = 1
  2388. Sound76.Name = "SmallBoom"
  2389. Sound76.Parent = Script59
  2390. Sound76.SoundId = "http://roblox.com/asset?id=180120107"
  2391. Script77.Name = "ShockwaveDamage"
  2392. Script77.Parent = Script59
  2393. table.insert(cors,sandbox(Script77,function()
  2394. local sp = script.Parent
  2395. local creator = sp:WaitForChild("creator")
  2396. local debounce = false
  2397.  
  2398.  
  2399. function damage(p)
  2400. if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(creator.Value) then
  2401. if debounce == false then
  2402. debounce = true
  2403. local hum = p.Parent:FindFirstChild("Humanoid")
  2404. local torso = p.Parent:FindFirstChild("Torso")
  2405. -- damage the player
  2406. hum:TakeDamage(math.random(30,50))
  2407. -- make decorations and realism
  2408. local bf = Instance.new("BodyForce", torso)
  2409. bf.Force = Vector3.new(0,9999,0)
  2410. game.Debris:AddItem(bf, 0.25)
  2411. end
  2412. end
  2413. end
  2414.  
  2415.  
  2416. script.Parent.Touched:connect(damage)
  2417.  
  2418. wait(0.5)
  2419. script.Disabled = true
  2420.  
  2421. end))
  2422. Script77.Disabled = true
  2423. Sound78.Name = "HoleCrack"
  2424. Sound78.Parent = Script59
  2425. Sound78.SoundId = "rbxassetid://3086666"
  2426. Sound78.Volume = 0.69999998807907
  2427. Script79.Name = "LavaScript"
  2428. Script79.Parent = Script59
  2429. table.insert(cors,sandbox(Script79,function()
  2430. local sp = script.Parent
  2431. wait(math.random(5, 6))
  2432.  
  2433. local group = Instance.new("Model", game.Workspace)
  2434. group.Name = "LavaEruption"
  2435. game.Debris:AddItem(group, 30)
  2436. for i = 1, 30 do
  2437. local lava = Instance.new("Part")
  2438. lava.Shape = "Ball"
  2439. lava.Size = Vector3.new(50,50,50)
  2440. lava.TopSurface = "Smooth"
  2441. lava.BottomSurface = "Smooth"
  2442. lava.CanCollide = false
  2443. lava.Anchored = false
  2444. lava.Transparency = 1
  2445. lava.CFrame = sp.CFrame
  2446. local effect = script:WaitForChild("LavaEffect"):Clone()
  2447. effect.Parent = lava
  2448. effect.Enabled = true
  2449. game.Debris:AddItem(lava, 10)
  2450. local bf = Instance.new("BodyForce", lava)
  2451. bf.Force = Vector3.new(0,999999999,0)
  2452. game.Debris:AddItem(bf, 1)
  2453. local sound = script:WaitForChild("SmallBoom"):Clone()
  2454. sound.Parent = lava
  2455. sound:Play()
  2456.  
  2457. lava.Parent = group
  2458.  
  2459. lava.Touched:connect(function(p)
  2460. if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(sp:WaitForChild("creator").Value) then
  2461. p.Parent:FindFirstChild("Humanoid"):TakeDamage(math.random(10,25))
  2462. end
  2463. end)
  2464.  
  2465. wait()
  2466. end
  2467.  
  2468. end))
  2469. Script79.Disabled = true
  2470. ParticleEmitter80.Name = "LavaEffect"
  2471. ParticleEmitter80.Parent = Script79
  2472. ParticleEmitter80.Speed = NumberRange.new(10, 10)
  2473. ParticleEmitter80.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0.666667, 0))
  2474. ParticleEmitter80.Enabled = false
  2475. ParticleEmitter80.LightEmission = 0.34999999403954
  2476. ParticleEmitter80.Texture = "rbxassetid://494864527"
  2477. ParticleEmitter80.Transparency = NumberSequence.new(0.50625002384186,0,1)
  2478. ParticleEmitter80.Size = NumberSequence.new(5.125,10,10,0)
  2479. ParticleEmitter80.Lifetime = NumberRange.new(0.5, 0.75)
  2480. ParticleEmitter80.Rate = 500
  2481. ParticleEmitter80.RotSpeed = NumberRange.new(-180, 180)
  2482. ParticleEmitter80.SpreadAngle = Vector2.new(-90, 90)
  2483. ParticleEmitter80.VelocitySpread = -90
  2484. Sound81.Name = "SmallBoom"
  2485. Sound81.Parent = Script79
  2486. Sound81.SoundId = "http://roblox.com/asset?id=180120107"
  2487. Shirt82.Name = "Shirt"
  2488. Shirt82.Parent = Model0
  2489. Shirt82.ShirtTemplate = "http://www.roblox.com/asset/?id=265030614"
  2490. Pants83.Name = "Pants"
  2491. Pants83.Parent = Model0
  2492. Pants83.PantsTemplate = "http://www.roblox.com/asset/?id=891568032"
  2493. Script84.Name = "Music (Or DeleteMe"
  2494. Script84.Parent = Model0
  2495. table.insert(cors,sandbox(Script84,function()
  2496. --Made by UltimateRobloxian35
  2497.  
  2498. local sound = Instance.new("Sound")
  2499.  
  2500. sound.Name = "Sound"
  2501. sound.SoundId = "http://www.roblox.com/asset/?id=1056097123" --Song
  2502. sound.Volume = .45 --Derp (I have good, loud speakers. You may need to change this.)
  2503. sound.Pitch = 1 --Speed of Playback
  2504. sound.Looped = true
  2505. sound.archivable = false
  2506.  
  2507. sound.Parent = game.Workspace
  2508.  
  2509. wait(0)
  2510.  
  2511. sound:play()
  2512.  
  2513. end))
  2514. Camera85.Name = "ThumbnailCamera"
  2515. Camera85.Parent = Model0
  2516. Camera85.CFrame = CFrame.new(-60.8967094, 6.47413206, 51.2634087, 0.999124408, 0.00890965201, 0.0408784039, 9.31322464e-10, 0.977062047, -0.212955549, -0.0418380871, 0.212769091, 0.976206481)
  2517. Camera85.CoordinateFrame = CFrame.new(-60.8967094, 6.47413206, 51.2634087, 0.999124408, 0.00890965201, 0.0408784039, 9.31322464e-10, 0.977062047, -0.212955549, -0.0418380871, 0.212769091, 0.976206481)
  2518. Camera85.FieldOfView = 39.999999303284
  2519. Camera85.Focus = CFrame.new(-60.978466, 6.90004206, 49.3110008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2520. Camera85.focus = CFrame.new(-60.978466, 6.90004206, 49.3110008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2521. BodyColors86.Parent = Model0
  2522. BodyColors86.HeadColor = BrickColor.new("Bright violet")
  2523. BodyColors86.HeadColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2524. BodyColors86.LeftArmColor = BrickColor.new("Bright violet")
  2525. BodyColors86.LeftArmColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2526. BodyColors86.LeftLegColor = BrickColor.new("Bright violet")
  2527. BodyColors86.LeftLegColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2528. BodyColors86.RightArmColor = BrickColor.new("Bright violet")
  2529. BodyColors86.RightArmColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2530. BodyColors86.RightLegColor = BrickColor.new("Bright violet")
  2531. BodyColors86.RightLegColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2532. BodyColors86.TorsoColor = BrickColor.new("Bright violet")
  2533. BodyColors86.TorsoColor3 = Color3.new(0.419608, 0.196078, 0.486275)
  2534. BodyColors87.Parent = Model0
  2535. BodyColors87.HeadColor = BrickColor.new("Light orange")
  2536. BodyColors87.HeadColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2537. BodyColors87.LeftArmColor = BrickColor.new("Light orange")
  2538. BodyColors87.LeftArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2539. BodyColors87.LeftLegColor = BrickColor.new("Light orange")
  2540. BodyColors87.LeftLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2541. BodyColors87.RightArmColor = BrickColor.new("Light orange")
  2542. BodyColors87.RightArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2543. BodyColors87.RightLegColor = BrickColor.new("Light orange")
  2544. BodyColors87.RightLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2545. BodyColors87.TorsoColor = BrickColor.new("Light orange")
  2546. BodyColors87.TorsoColor3 = Color3.new(0.917647, 0.721569, 0.572549)
  2547. for i,v in pairs(mas:GetChildren()) do
  2548. v.Parent = script
  2549. pcall(function() v:MakeJoints() end)
  2550. end
  2551. mas:Destroy()
  2552. for i,v in pairs(cors) do
  2553. spawn(function()
  2554. pcall(v)
  2555. end)
  2556. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement