Advertisement
lafur

Untitled

May 24th, 2020
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 92.65 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 7327
  3. local genv={}
  4. local Scripts = {
  5. function() -- Created by Quenty (@Quenty, follow me on twitter).
  6. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  7. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  8.  
  9. --[[ INSTRUCTIONS
  10. - Place in the model
  11. - Make sure model is anchored
  12. - That's it. It will weld the model and all children.
  13.  
  14. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  15. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  16. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  17. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  18. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  19. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  20. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  21. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  22.  
  23. 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.
  24. ]]
  25.  
  26. --[[ DOCUMENTATION
  27. - 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.
  28. - Will work in PBS servers
  29. - Will work as long as it starts out with the part anchored
  30. - Stores the relative CFrame as a CFrame value
  31. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  32. - Utilizes a recursive algorith to find all parts in the model
  33. - Will reweld on script reparent if the script is initially parented to a tool.
  34. - Welds as fast as possible
  35. ]]
  36.  
  37. -- qPerfectionWeld.lua
  38. -- Created 10/6/2014
  39. -- Author: Quenty
  40. -- Version 1.0.3
  41.  
  42. -- Updated 10/14/2014 - Updated to 1.0.1
  43. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  44.  
  45. -- Updated 10/14/2014 - Updated to 1.0.2
  46. --- Fixed bug fix.
  47.  
  48. -- Updated 10/14/2014 - Updated to 1.0.3
  49. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  50.  
  51. 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).
  52.  
  53.  
  54. local function CallOnChildren(Instance, FunctionToCall)
  55. -- Calls a function on each of the children of a certain object, using recursion.
  56.  
  57. FunctionToCall(Instance)
  58.  
  59. for _, Child in next, Instance:GetChildren() do
  60. CallOnChildren(Child, FunctionToCall)
  61. end
  62. end
  63.  
  64. local function GetNearestParent(Instance, ClassName)
  65. -- Returns the nearest parent of a certain class, or returns nil
  66.  
  67. local Ancestor = Instance
  68. repeat
  69. Ancestor = Ancestor.Parent
  70. if Ancestor == nil then
  71. return nil
  72. end
  73. until Ancestor:IsA(ClassName)
  74.  
  75. return Ancestor
  76. end
  77.  
  78. local function GetBricks(StartInstance)
  79. local List = {}
  80.  
  81. -- if StartInstance:IsA("BasePart") then
  82. -- List[#List+1] = StartInstance
  83. -- end
  84.  
  85. CallOnChildren(StartInstance, function(Item)
  86. if Item:IsA("BasePart") then
  87. List[#List+1] = Item;
  88. end
  89. end)
  90.  
  91. return List
  92. end
  93.  
  94. local function Modify(Instance, Values)
  95. -- Modifies an Instance by using a table.
  96.  
  97. assert(type(Values) == "table", "Values is not a table");
  98.  
  99. for Index, Value in next, Values do
  100. if type(Index) == "number" then
  101. Value.Parent = Instance
  102. else
  103. Instance[Index] = Value
  104. end
  105. end
  106. return Instance
  107. end
  108.  
  109. local function Make(ClassType, Properties)
  110. -- Using a syntax hack to create a nice way to Make new items.
  111.  
  112. return Modify(Instance.new(ClassType), Properties)
  113. end
  114.  
  115. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  116. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  117.  
  118. local function HasWheelJoint(Part)
  119. for _, SurfaceName in pairs(Surfaces) do
  120. for _, HingSurfaceName in pairs(HingSurfaces) do
  121. if Part[SurfaceName].Name == HingSurfaceName then
  122. return true
  123. end
  124. end
  125. end
  126.  
  127. return false
  128. end
  129.  
  130. local function ShouldBreakJoints(Part)
  131. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  132. -- definitely some edge cases.
  133.  
  134. if NEVER_BREAK_JOINTS then
  135. return false
  136. end
  137.  
  138. if HasWheelJoint(Part) then
  139. return false
  140. end
  141.  
  142. local Connected = Part:GetConnectedParts()
  143.  
  144. if #Connected == 1 then
  145. return false
  146. end
  147.  
  148. for _, Item in pairs(Connected) do
  149. if HasWheelJoint(Item) then
  150. return false
  151. elseif not Item:IsDescendantOf(script.Parent) then
  152. return false
  153. end
  154. end
  155.  
  156. return true
  157. end
  158.  
  159. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  160. --- Weld's 2 parts together
  161. -- @param Part0 The first part
  162. -- @param Part1 The second part (Dependent part most of the time).
  163. -- @param [JointType] The type of joint. Defaults to weld.
  164. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  165. -- @return The weld created.
  166.  
  167. JointType = JointType or "Weld"
  168. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  169.  
  170. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  171. Modify(NewWeld, {
  172. Name = "qCFrameWeldThingy";
  173. Part0 = Part0;
  174. Part1 = Part1;
  175. C0 = CFrame.new();--Part0.CFrame:inverse();
  176. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  177. Parent = Part1;
  178. })
  179.  
  180. if not RelativeValue then
  181. RelativeValue = Make("CFrameValue", {
  182. Parent = Part1;
  183. Name = "qRelativeCFrameWeldValue";
  184. Archivable = true;
  185. Value = NewWeld.C1;
  186. })
  187. end
  188.  
  189. return NewWeld
  190. end
  191.  
  192. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  193. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  194. -- @param MainPart The part to weld the model to (can be in the model).
  195. -- @param [JointType] The type of joint. Defaults to weld.
  196. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  197.  
  198. for _, Part in pairs(Parts) do
  199. if ShouldBreakJoints(Part) then
  200. Part:BreakJoints()
  201. end
  202. end
  203.  
  204. for _, Part in pairs(Parts) do
  205. if Part ~= MainPart then
  206. WeldTogether(MainPart, Part, JointType, MainPart)
  207. end
  208. end
  209.  
  210. if not DoNotUnanchor then
  211. for _, Part in pairs(Parts) do
  212. Part.Anchored = false
  213. end
  214. MainPart.Anchored = false
  215. end
  216. end
  217.  
  218. local function PerfectionWeld()
  219. local Tool = GetNearestParent(script, "Tool")
  220.  
  221. local Parts = GetBricks(script.Parent)
  222. 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]
  223.  
  224. if PrimaryPart then
  225. WeldParts(Parts, PrimaryPart, "Weld", false)
  226. else
  227. warn("qWeld - Unable to weld part")
  228. end
  229.  
  230. return Tool
  231. end
  232.  
  233. local Tool = PerfectionWeld()
  234.  
  235.  
  236. if Tool and script.ClassName == "Script" then
  237. --- Don't bother with local scripts
  238.  
  239. script.Parent.AncestryChanged:connect(function()
  240. PerfectionWeld()
  241. end)
  242. end
  243.  
  244. -- Created by Quenty (@Quenty, follow me on twitter).
  245. end;
  246. function() -- Script by XcorrectTheDev
  247.  
  248. local AlreadyRandom = false
  249. local PitchSet = false
  250.  
  251. while wait() do
  252. if script.Parent.IsPlaying then
  253. wait(5)
  254. local RandomSound = math.random(1,3)
  255. if RandomSound == 1 or 3 and not AlreadyRandom then
  256. AlreadyRandom = true
  257. script.Parent.PlaybackSpeed = math.random(0.8,0.85)
  258. PitchSet = true
  259. end
  260. if RandomSound == 2 and not AlreadyRandom then
  261. AlreadyRandom = true
  262. script.Parent.PlaybackSpeed = math.random(0.85,0.8)
  263. PitchSet = true
  264. end
  265. end
  266. end
  267.  
  268. spawn(function()
  269. while wait() do
  270. if PitchSet then
  271. if script.Parent.IsPlaying then
  272. AlreadyRandom = false
  273. PitchSet = false
  274. end
  275. end
  276. end
  277. end)
  278. end;
  279. function() -- Created by Quenty (@Quenty, follow me on twitter).
  280. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  281. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  282.  
  283. --[[ INSTRUCTIONS
  284. - Place in the model
  285. - Make sure model is anchored
  286. - That's it. It will weld the model and all children.
  287.  
  288. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  289. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  290. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  291. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  292. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  293. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  294. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  295. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  296.  
  297. 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.
  298. ]]
  299.  
  300. --[[ DOCUMENTATION
  301. - 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.
  302. - Will work in PBS servers
  303. - Will work as long as it starts out with the part anchored
  304. - Stores the relative CFrame as a CFrame value
  305. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  306. - Utilizes a recursive algorith to find all parts in the model
  307. - Will reweld on script reparent if the script is initially parented to a tool.
  308. - Welds as fast as possible
  309. ]]
  310.  
  311. -- qPerfectionWeld.lua
  312. -- Created 10/6/2014
  313. -- Author: Quenty
  314. -- Version 1.0.3
  315.  
  316. -- Updated 10/14/2014 - Updated to 1.0.1
  317. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  318.  
  319. -- Updated 10/14/2014 - Updated to 1.0.2
  320. --- Fixed bug fix.
  321.  
  322. -- Updated 10/14/2014 - Updated to 1.0.3
  323. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  324.  
  325. 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).
  326.  
  327.  
  328. local function CallOnChildren(Instance, FunctionToCall)
  329. -- Calls a function on each of the children of a certain object, using recursion.
  330.  
  331. FunctionToCall(Instance)
  332.  
  333. for _, Child in next, Instance:GetChildren() do
  334. CallOnChildren(Child, FunctionToCall)
  335. end
  336. end
  337.  
  338. local function GetNearestParent(Instance, ClassName)
  339. -- Returns the nearest parent of a certain class, or returns nil
  340.  
  341. local Ancestor = Instance
  342. repeat
  343. Ancestor = Ancestor.Parent
  344. if Ancestor == nil then
  345. return nil
  346. end
  347. until Ancestor:IsA(ClassName)
  348.  
  349. return Ancestor
  350. end
  351.  
  352. local function GetBricks(StartInstance)
  353. local List = {}
  354.  
  355. -- if StartInstance:IsA("BasePart") then
  356. -- List[#List+1] = StartInstance
  357. -- end
  358.  
  359. CallOnChildren(StartInstance, function(Item)
  360. if Item:IsA("BasePart") then
  361. List[#List+1] = Item;
  362. end
  363. end)
  364.  
  365. return List
  366. end
  367.  
  368. local function Modify(Instance, Values)
  369. -- Modifies an Instance by using a table.
  370.  
  371. assert(type(Values) == "table", "Values is not a table");
  372.  
  373. for Index, Value in next, Values do
  374. if type(Index) == "number" then
  375. Value.Parent = Instance
  376. else
  377. Instance[Index] = Value
  378. end
  379. end
  380. return Instance
  381. end
  382.  
  383. local function Make(ClassType, Properties)
  384. -- Using a syntax hack to create a nice way to Make new items.
  385.  
  386. return Modify(Instance.new(ClassType), Properties)
  387. end
  388.  
  389. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  390. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  391.  
  392. local function HasWheelJoint(Part)
  393. for _, SurfaceName in pairs(Surfaces) do
  394. for _, HingSurfaceName in pairs(HingSurfaces) do
  395. if Part[SurfaceName].Name == HingSurfaceName then
  396. return true
  397. end
  398. end
  399. end
  400.  
  401. return false
  402. end
  403.  
  404. local function ShouldBreakJoints(Part)
  405. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  406. -- definitely some edge cases.
  407.  
  408. if NEVER_BREAK_JOINTS then
  409. return false
  410. end
  411.  
  412. if HasWheelJoint(Part) then
  413. return false
  414. end
  415.  
  416. local Connected = Part:GetConnectedParts()
  417.  
  418. if #Connected == 1 then
  419. return false
  420. end
  421.  
  422. for _, Item in pairs(Connected) do
  423. if HasWheelJoint(Item) then
  424. return false
  425. elseif not Item:IsDescendantOf(script.Parent) then
  426. return false
  427. end
  428. end
  429.  
  430. return true
  431. end
  432.  
  433. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  434. --- Weld's 2 parts together
  435. -- @param Part0 The first part
  436. -- @param Part1 The second part (Dependent part most of the time).
  437. -- @param [JointType] The type of joint. Defaults to weld.
  438. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  439. -- @return The weld created.
  440.  
  441. JointType = JointType or "Weld"
  442. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  443.  
  444. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  445. Modify(NewWeld, {
  446. Name = "qCFrameWeldThingy";
  447. Part0 = Part0;
  448. Part1 = Part1;
  449. C0 = CFrame.new();--Part0.CFrame:inverse();
  450. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  451. Parent = Part1;
  452. })
  453.  
  454. if not RelativeValue then
  455. RelativeValue = Make("CFrameValue", {
  456. Parent = Part1;
  457. Name = "qRelativeCFrameWeldValue";
  458. Archivable = true;
  459. Value = NewWeld.C1;
  460. })
  461. end
  462.  
  463. return NewWeld
  464. end
  465.  
  466. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  467. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  468. -- @param MainPart The part to weld the model to (can be in the model).
  469. -- @param [JointType] The type of joint. Defaults to weld.
  470. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  471.  
  472. for _, Part in pairs(Parts) do
  473. if ShouldBreakJoints(Part) then
  474. Part:BreakJoints()
  475. end
  476. end
  477.  
  478. for _, Part in pairs(Parts) do
  479. if Part ~= MainPart then
  480. WeldTogether(MainPart, Part, JointType, MainPart)
  481. end
  482. end
  483.  
  484. if not DoNotUnanchor then
  485. for _, Part in pairs(Parts) do
  486. Part.Anchored = false
  487. end
  488. MainPart.Anchored = false
  489. end
  490. end
  491.  
  492. local function PerfectionWeld()
  493. local Tool = GetNearestParent(script, "Tool")
  494.  
  495. local Parts = GetBricks(script.Parent)
  496. 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]
  497.  
  498. if PrimaryPart then
  499. WeldParts(Parts, PrimaryPart, "Weld", false)
  500. else
  501. warn("qWeld - Unable to weld part")
  502. end
  503.  
  504. return Tool
  505. end
  506.  
  507. local Tool = PerfectionWeld()
  508.  
  509.  
  510. if Tool and script.ClassName == "Script" then
  511. --- Don't bother with local scripts
  512.  
  513. script.Parent.AncestryChanged:connect(function()
  514. PerfectionWeld()
  515. end)
  516. end
  517.  
  518. -- Created by Quenty (@Quenty, follow me on twitter).
  519. end;
  520. function() -- Script by XcorrectTheDev
  521.  
  522. local Debounce = false
  523. local Damage = script.Parent.Parent.Parent.Configuration.Damage.Value
  524.  
  525. function OnTouched(Hit)
  526. if Hit.Parent ~= nil then
  527. if Debounce == false and Hit.Parent:findFirstChildOfClass("Humanoid") ~= nil then
  528. if Hit.Parent:findFirstChildOfClass("Humanoid").Health > 0 then
  529. Debounce = true
  530. local Animation = script.Parent.Parent.Parent:FindFirstChild("Swing")
  531. local Rake = script.Parent.Parent.Parent:FindFirstChild("NPC")
  532. local Attack = Rake:LoadAnimation(Animation)
  533. Attack:Play()
  534. Attack:AdjustSpeed(2+(math.random()*0.2))
  535. script.Parent.Parent.Swing.Pitch=1+(math.random()*0.04);
  536. script.Parent.Parent.Swing:Play()
  537. wait(0.2)
  538. Hit.Parent:findFirstChildOfClass("Humanoid"):TakeDamage(Damage)
  539. script.Parent.Parent.Hit.Pitch=1+(math.random()*0.04);
  540. script.Parent.Parent.Hit:Play()
  541. wait(1)
  542. Debounce = false
  543. end
  544. end
  545. end
  546. end
  547.  
  548. script.Parent.Touched:Connect(OnTouched) end;
  549. function() -- Script by XcorrectTheDev
  550.  
  551. function Blood()
  552. script.Parent.Blood.Enabled = true
  553. script.Parent.Blood2.Enabled = true
  554. script.Parent.Parent.Head.Eye1 = BrickColor.new("Really black")
  555. script.Parent.Parent.Head.Eye2 = BrickColor.new("Really black")
  556. end
  557. script.Parent.Parent.NPC.Died:Connect(Blood) end;
  558. function() -- Created by Quenty (@Quenty, follow me on twitter).
  559. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  560. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  561.  
  562. --[[ INSTRUCTIONS
  563. - Place in the model
  564. - Make sure model is anchored
  565. - That's it. It will weld the model and all children.
  566.  
  567. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  568. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  569. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  570. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  571. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  572. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  573. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  574. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  575.  
  576. 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.
  577. ]]
  578.  
  579. --[[ DOCUMENTATION
  580. - 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.
  581. - Will work in PBS servers
  582. - Will work as long as it starts out with the part anchored
  583. - Stores the relative CFrame as a CFrame value
  584. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  585. - Utilizes a recursive algorith to find all parts in the model
  586. - Will reweld on script reparent if the script is initially parented to a tool.
  587. - Welds as fast as possible
  588. ]]
  589.  
  590. -- qPerfectionWeld.lua
  591. -- Created 10/6/2014
  592. -- Author: Quenty
  593. -- Version 1.0.3
  594.  
  595. -- Updated 10/14/2014 - Updated to 1.0.1
  596. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  597.  
  598. -- Updated 10/14/2014 - Updated to 1.0.2
  599. --- Fixed bug fix.
  600.  
  601. -- Updated 10/14/2014 - Updated to 1.0.3
  602. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  603.  
  604. 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).
  605.  
  606.  
  607. local function CallOnChildren(Instance, FunctionToCall)
  608. -- Calls a function on each of the children of a certain object, using recursion.
  609.  
  610. FunctionToCall(Instance)
  611.  
  612. for _, Child in next, Instance:GetChildren() do
  613. CallOnChildren(Child, FunctionToCall)
  614. end
  615. end
  616.  
  617. local function GetNearestParent(Instance, ClassName)
  618. -- Returns the nearest parent of a certain class, or returns nil
  619.  
  620. local Ancestor = Instance
  621. repeat
  622. Ancestor = Ancestor.Parent
  623. if Ancestor == nil then
  624. return nil
  625. end
  626. until Ancestor:IsA(ClassName)
  627.  
  628. return Ancestor
  629. end
  630.  
  631. local function GetBricks(StartInstance)
  632. local List = {}
  633.  
  634. -- if StartInstance:IsA("BasePart") then
  635. -- List[#List+1] = StartInstance
  636. -- end
  637.  
  638. CallOnChildren(StartInstance, function(Item)
  639. if Item:IsA("BasePart") then
  640. List[#List+1] = Item;
  641. end
  642. end)
  643.  
  644. return List
  645. end
  646.  
  647. local function Modify(Instance, Values)
  648. -- Modifies an Instance by using a table.
  649.  
  650. assert(type(Values) == "table", "Values is not a table");
  651.  
  652. for Index, Value in next, Values do
  653. if type(Index) == "number" then
  654. Value.Parent = Instance
  655. else
  656. Instance[Index] = Value
  657. end
  658. end
  659. return Instance
  660. end
  661.  
  662. local function Make(ClassType, Properties)
  663. -- Using a syntax hack to create a nice way to Make new items.
  664.  
  665. return Modify(Instance.new(ClassType), Properties)
  666. end
  667.  
  668. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  669. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  670.  
  671. local function HasWheelJoint(Part)
  672. for _, SurfaceName in pairs(Surfaces) do
  673. for _, HingSurfaceName in pairs(HingSurfaces) do
  674. if Part[SurfaceName].Name == HingSurfaceName then
  675. return true
  676. end
  677. end
  678. end
  679.  
  680. return false
  681. end
  682.  
  683. local function ShouldBreakJoints(Part)
  684. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  685. -- definitely some edge cases.
  686.  
  687. if NEVER_BREAK_JOINTS then
  688. return false
  689. end
  690.  
  691. if HasWheelJoint(Part) then
  692. return false
  693. end
  694.  
  695. local Connected = Part:GetConnectedParts()
  696.  
  697. if #Connected == 1 then
  698. return false
  699. end
  700.  
  701. for _, Item in pairs(Connected) do
  702. if HasWheelJoint(Item) then
  703. return false
  704. elseif not Item:IsDescendantOf(script.Parent) then
  705. return false
  706. end
  707. end
  708.  
  709. return true
  710. end
  711.  
  712. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  713. --- Weld's 2 parts together
  714. -- @param Part0 The first part
  715. -- @param Part1 The second part (Dependent part most of the time).
  716. -- @param [JointType] The type of joint. Defaults to weld.
  717. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  718. -- @return The weld created.
  719.  
  720. JointType = JointType or "Weld"
  721. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  722.  
  723. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  724. Modify(NewWeld, {
  725. Name = "qCFrameWeldThingy";
  726. Part0 = Part0;
  727. Part1 = Part1;
  728. C0 = CFrame.new();--Part0.CFrame:inverse();
  729. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  730. Parent = Part1;
  731. })
  732.  
  733. if not RelativeValue then
  734. RelativeValue = Make("CFrameValue", {
  735. Parent = Part1;
  736. Name = "qRelativeCFrameWeldValue";
  737. Archivable = true;
  738. Value = NewWeld.C1;
  739. })
  740. end
  741.  
  742. return NewWeld
  743. end
  744.  
  745. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  746. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  747. -- @param MainPart The part to weld the model to (can be in the model).
  748. -- @param [JointType] The type of joint. Defaults to weld.
  749. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  750.  
  751. for _, Part in pairs(Parts) do
  752. if ShouldBreakJoints(Part) then
  753. Part:BreakJoints()
  754. end
  755. end
  756.  
  757. for _, Part in pairs(Parts) do
  758. if Part ~= MainPart then
  759. WeldTogether(MainPart, Part, JointType, MainPart)
  760. end
  761. end
  762.  
  763. if not DoNotUnanchor then
  764. for _, Part in pairs(Parts) do
  765. Part.Anchored = false
  766. end
  767. MainPart.Anchored = false
  768. end
  769. end
  770.  
  771. local function PerfectionWeld()
  772. local Tool = GetNearestParent(script, "Tool")
  773.  
  774. local Parts = GetBricks(script.Parent)
  775. 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]
  776.  
  777. if PrimaryPart then
  778. WeldParts(Parts, PrimaryPart, "Weld", false)
  779. else
  780. warn("qWeld - Unable to weld part")
  781. end
  782.  
  783. return Tool
  784. end
  785.  
  786. local Tool = PerfectionWeld()
  787.  
  788.  
  789. if Tool and script.ClassName == "Script" then
  790. --- Don't bother with local scripts
  791.  
  792. script.Parent.AncestryChanged:connect(function()
  793. PerfectionWeld()
  794. end)
  795. end
  796.  
  797. -- Created by Quenty (@Quenty, follow me on twitter).
  798. end;
  799. function() -- Created by Quenty (@Quenty, follow me on twitter).
  800. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  801. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  802.  
  803. --[[ INSTRUCTIONS
  804. - Place in the model
  805. - Make sure model is anchored
  806. - That's it. It will weld the model and all children.
  807.  
  808. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  809. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  810. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  811. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  812. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  813. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  814. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  815. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  816.  
  817. 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.
  818. ]]
  819.  
  820. --[[ DOCUMENTATION
  821. - 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.
  822. - Will work in PBS servers
  823. - Will work as long as it starts out with the part anchored
  824. - Stores the relative CFrame as a CFrame value
  825. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  826. - Utilizes a recursive algorith to find all parts in the model
  827. - Will reweld on script reparent if the script is initially parented to a tool.
  828. - Welds as fast as possible
  829. ]]
  830.  
  831. -- qPerfectionWeld.lua
  832. -- Created 10/6/2014
  833. -- Author: Quenty
  834. -- Version 1.0.3
  835.  
  836. -- Updated 10/14/2014 - Updated to 1.0.1
  837. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  838.  
  839. -- Updated 10/14/2014 - Updated to 1.0.2
  840. --- Fixed bug fix.
  841.  
  842. -- Updated 10/14/2014 - Updated to 1.0.3
  843. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  844.  
  845. 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).
  846.  
  847.  
  848. local function CallOnChildren(Instance, FunctionToCall)
  849. -- Calls a function on each of the children of a certain object, using recursion.
  850.  
  851. FunctionToCall(Instance)
  852.  
  853. for _, Child in next, Instance:GetChildren() do
  854. CallOnChildren(Child, FunctionToCall)
  855. end
  856. end
  857.  
  858. local function GetNearestParent(Instance, ClassName)
  859. -- Returns the nearest parent of a certain class, or returns nil
  860.  
  861. local Ancestor = Instance
  862. repeat
  863. Ancestor = Ancestor.Parent
  864. if Ancestor == nil then
  865. return nil
  866. end
  867. until Ancestor:IsA(ClassName)
  868.  
  869. return Ancestor
  870. end
  871.  
  872. local function GetBricks(StartInstance)
  873. local List = {}
  874.  
  875. -- if StartInstance:IsA("BasePart") then
  876. -- List[#List+1] = StartInstance
  877. -- end
  878.  
  879. CallOnChildren(StartInstance, function(Item)
  880. if Item:IsA("BasePart") then
  881. List[#List+1] = Item;
  882. end
  883. end)
  884.  
  885. return List
  886. end
  887.  
  888. local function Modify(Instance, Values)
  889. -- Modifies an Instance by using a table.
  890.  
  891. assert(type(Values) == "table", "Values is not a table");
  892.  
  893. for Index, Value in next, Values do
  894. if type(Index) == "number" then
  895. Value.Parent = Instance
  896. else
  897. Instance[Index] = Value
  898. end
  899. end
  900. return Instance
  901. end
  902.  
  903. local function Make(ClassType, Properties)
  904. -- Using a syntax hack to create a nice way to Make new items.
  905.  
  906. return Modify(Instance.new(ClassType), Properties)
  907. end
  908.  
  909. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  910. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  911.  
  912. local function HasWheelJoint(Part)
  913. for _, SurfaceName in pairs(Surfaces) do
  914. for _, HingSurfaceName in pairs(HingSurfaces) do
  915. if Part[SurfaceName].Name == HingSurfaceName then
  916. return true
  917. end
  918. end
  919. end
  920.  
  921. return false
  922. end
  923.  
  924. local function ShouldBreakJoints(Part)
  925. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  926. -- definitely some edge cases.
  927.  
  928. if NEVER_BREAK_JOINTS then
  929. return false
  930. end
  931.  
  932. if HasWheelJoint(Part) then
  933. return false
  934. end
  935.  
  936. local Connected = Part:GetConnectedParts()
  937.  
  938. if #Connected == 1 then
  939. return false
  940. end
  941.  
  942. for _, Item in pairs(Connected) do
  943. if HasWheelJoint(Item) then
  944. return false
  945. elseif not Item:IsDescendantOf(script.Parent) then
  946. return false
  947. end
  948. end
  949.  
  950. return true
  951. end
  952.  
  953. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  954. --- Weld's 2 parts together
  955. -- @param Part0 The first part
  956. -- @param Part1 The second part (Dependent part most of the time).
  957. -- @param [JointType] The type of joint. Defaults to weld.
  958. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  959. -- @return The weld created.
  960.  
  961. JointType = JointType or "Weld"
  962. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  963.  
  964. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  965. Modify(NewWeld, {
  966. Name = "qCFrameWeldThingy";
  967. Part0 = Part0;
  968. Part1 = Part1;
  969. C0 = CFrame.new();--Part0.CFrame:inverse();
  970. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  971. Parent = Part1;
  972. })
  973.  
  974. if not RelativeValue then
  975. RelativeValue = Make("CFrameValue", {
  976. Parent = Part1;
  977. Name = "qRelativeCFrameWeldValue";
  978. Archivable = true;
  979. Value = NewWeld.C1;
  980. })
  981. end
  982.  
  983. return NewWeld
  984. end
  985.  
  986. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  987. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  988. -- @param MainPart The part to weld the model to (can be in the model).
  989. -- @param [JointType] The type of joint. Defaults to weld.
  990. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  991.  
  992. for _, Part in pairs(Parts) do
  993. if ShouldBreakJoints(Part) then
  994. Part:BreakJoints()
  995. end
  996. end
  997.  
  998. for _, Part in pairs(Parts) do
  999. if Part ~= MainPart then
  1000. WeldTogether(MainPart, Part, JointType, MainPart)
  1001. end
  1002. end
  1003.  
  1004. if not DoNotUnanchor then
  1005. for _, Part in pairs(Parts) do
  1006. Part.Anchored = false
  1007. end
  1008. MainPart.Anchored = false
  1009. end
  1010. end
  1011.  
  1012. local function PerfectionWeld()
  1013. local Tool = GetNearestParent(script, "Tool")
  1014.  
  1015. local Parts = GetBricks(script.Parent)
  1016. 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]
  1017.  
  1018. if PrimaryPart then
  1019. WeldParts(Parts, PrimaryPart, "Weld", false)
  1020. else
  1021. warn("qWeld - Unable to weld part")
  1022. end
  1023.  
  1024. return Tool
  1025. end
  1026.  
  1027. local Tool = PerfectionWeld()
  1028.  
  1029.  
  1030. if Tool and script.ClassName == "Script" then
  1031. --- Don't bother with local scripts
  1032.  
  1033. script.Parent.AncestryChanged:connect(function()
  1034. PerfectionWeld()
  1035. end)
  1036. end
  1037.  
  1038. -- Created by Quenty (@Quenty, follow me on twitter).
  1039. end;
  1040. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1041. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1042. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1043.  
  1044. --[[ INSTRUCTIONS
  1045. - Place in the model
  1046. - Make sure model is anchored
  1047. - That's it. It will weld the model and all children.
  1048.  
  1049. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1050. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1051. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1052. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1053. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1054. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1055. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1056. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1057.  
  1058. 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.
  1059. ]]
  1060.  
  1061. --[[ DOCUMENTATION
  1062. - 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.
  1063. - Will work in PBS servers
  1064. - Will work as long as it starts out with the part anchored
  1065. - Stores the relative CFrame as a CFrame value
  1066. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1067. - Utilizes a recursive algorith to find all parts in the model
  1068. - Will reweld on script reparent if the script is initially parented to a tool.
  1069. - Welds as fast as possible
  1070. ]]
  1071.  
  1072. -- qPerfectionWeld.lua
  1073. -- Created 10/6/2014
  1074. -- Author: Quenty
  1075. -- Version 1.0.3
  1076.  
  1077. -- Updated 10/14/2014 - Updated to 1.0.1
  1078. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1079.  
  1080. -- Updated 10/14/2014 - Updated to 1.0.2
  1081. --- Fixed bug fix.
  1082.  
  1083. -- Updated 10/14/2014 - Updated to 1.0.3
  1084. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1085.  
  1086. 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).
  1087.  
  1088.  
  1089. local function CallOnChildren(Instance, FunctionToCall)
  1090. -- Calls a function on each of the children of a certain object, using recursion.
  1091.  
  1092. FunctionToCall(Instance)
  1093.  
  1094. for _, Child in next, Instance:GetChildren() do
  1095. CallOnChildren(Child, FunctionToCall)
  1096. end
  1097. end
  1098.  
  1099. local function GetNearestParent(Instance, ClassName)
  1100. -- Returns the nearest parent of a certain class, or returns nil
  1101.  
  1102. local Ancestor = Instance
  1103. repeat
  1104. Ancestor = Ancestor.Parent
  1105. if Ancestor == nil then
  1106. return nil
  1107. end
  1108. until Ancestor:IsA(ClassName)
  1109.  
  1110. return Ancestor
  1111. end
  1112.  
  1113. local function GetBricks(StartInstance)
  1114. local List = {}
  1115.  
  1116. -- if StartInstance:IsA("BasePart") then
  1117. -- List[#List+1] = StartInstance
  1118. -- end
  1119.  
  1120. CallOnChildren(StartInstance, function(Item)
  1121. if Item:IsA("BasePart") then
  1122. List[#List+1] = Item;
  1123. end
  1124. end)
  1125.  
  1126. return List
  1127. end
  1128.  
  1129. local function Modify(Instance, Values)
  1130. -- Modifies an Instance by using a table.
  1131.  
  1132. assert(type(Values) == "table", "Values is not a table");
  1133.  
  1134. for Index, Value in next, Values do
  1135. if type(Index) == "number" then
  1136. Value.Parent = Instance
  1137. else
  1138. Instance[Index] = Value
  1139. end
  1140. end
  1141. return Instance
  1142. end
  1143.  
  1144. local function Make(ClassType, Properties)
  1145. -- Using a syntax hack to create a nice way to Make new items.
  1146.  
  1147. return Modify(Instance.new(ClassType), Properties)
  1148. end
  1149.  
  1150. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1151. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1152.  
  1153. local function HasWheelJoint(Part)
  1154. for _, SurfaceName in pairs(Surfaces) do
  1155. for _, HingSurfaceName in pairs(HingSurfaces) do
  1156. if Part[SurfaceName].Name == HingSurfaceName then
  1157. return true
  1158. end
  1159. end
  1160. end
  1161.  
  1162. return false
  1163. end
  1164.  
  1165. local function ShouldBreakJoints(Part)
  1166. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1167. -- definitely some edge cases.
  1168.  
  1169. if NEVER_BREAK_JOINTS then
  1170. return false
  1171. end
  1172.  
  1173. if HasWheelJoint(Part) then
  1174. return false
  1175. end
  1176.  
  1177. local Connected = Part:GetConnectedParts()
  1178.  
  1179. if #Connected == 1 then
  1180. return false
  1181. end
  1182.  
  1183. for _, Item in pairs(Connected) do
  1184. if HasWheelJoint(Item) then
  1185. return false
  1186. elseif not Item:IsDescendantOf(script.Parent) then
  1187. return false
  1188. end
  1189. end
  1190.  
  1191. return true
  1192. end
  1193.  
  1194. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1195. --- Weld's 2 parts together
  1196. -- @param Part0 The first part
  1197. -- @param Part1 The second part (Dependent part most of the time).
  1198. -- @param [JointType] The type of joint. Defaults to weld.
  1199. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1200. -- @return The weld created.
  1201.  
  1202. JointType = JointType or "Weld"
  1203. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1204.  
  1205. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1206. Modify(NewWeld, {
  1207. Name = "qCFrameWeldThingy";
  1208. Part0 = Part0;
  1209. Part1 = Part1;
  1210. C0 = CFrame.new();--Part0.CFrame:inverse();
  1211. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1212. Parent = Part1;
  1213. })
  1214.  
  1215. if not RelativeValue then
  1216. RelativeValue = Make("CFrameValue", {
  1217. Parent = Part1;
  1218. Name = "qRelativeCFrameWeldValue";
  1219. Archivable = true;
  1220. Value = NewWeld.C1;
  1221. })
  1222. end
  1223.  
  1224. return NewWeld
  1225. end
  1226.  
  1227. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1228. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1229. -- @param MainPart The part to weld the model to (can be in the model).
  1230. -- @param [JointType] The type of joint. Defaults to weld.
  1231. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1232.  
  1233. for _, Part in pairs(Parts) do
  1234. if ShouldBreakJoints(Part) then
  1235. Part:BreakJoints()
  1236. end
  1237. end
  1238.  
  1239. for _, Part in pairs(Parts) do
  1240. if Part ~= MainPart then
  1241. WeldTogether(MainPart, Part, JointType, MainPart)
  1242. end
  1243. end
  1244.  
  1245. if not DoNotUnanchor then
  1246. for _, Part in pairs(Parts) do
  1247. Part.Anchored = false
  1248. end
  1249. MainPart.Anchored = false
  1250. end
  1251. end
  1252.  
  1253. local function PerfectionWeld()
  1254. local Tool = GetNearestParent(script, "Tool")
  1255.  
  1256. local Parts = GetBricks(script.Parent)
  1257. 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]
  1258.  
  1259. if PrimaryPart then
  1260. WeldParts(Parts, PrimaryPart, "Weld", false)
  1261. else
  1262. warn("qWeld - Unable to weld part")
  1263. end
  1264.  
  1265. return Tool
  1266. end
  1267.  
  1268. local Tool = PerfectionWeld()
  1269.  
  1270.  
  1271. if Tool and script.ClassName == "Script" then
  1272. --- Don't bother with local scripts
  1273.  
  1274. script.Parent.AncestryChanged:connect(function()
  1275. PerfectionWeld()
  1276. end)
  1277. end
  1278.  
  1279. -- Created by Quenty (@Quenty, follow me on twitter).
  1280. end;
  1281. function() --[[Script by XcorrectTheDev
  1282. If you set AllowToTakeTheModel to true that allow the player to-
  1283. click the rake head and get the model ]]
  1284.  
  1285. local Head = script.Parent.Parent.Parent.Head
  1286. local AllowToTakeTheModel = script.Parent.Value
  1287. local ItemID = 2813016734 -- This is this model id
  1288.  
  1289. if AllowToTakeTheModel then -- Check if AllowToTakeTheModel is true
  1290. Head.ClickDetector.MaxActivationDistance = 40
  1291. else -- Else mean if AllowToTakeTheModel is false
  1292. Head.ClickDetector.MaxActivationDistance = 0
  1293. end
  1294.  
  1295. Head.ClickDetector.MouseClick:Connect(function(OnClick) -- Check if player mouse is click the rake head
  1296. game:GetService("MarketplaceService"):PromptPurchase(OnClick,ItemID)
  1297. end) end;
  1298. function() -- Script by XcorrectTheDev
  1299.  
  1300. local Config = script.Parent.Parent
  1301. local UsedRakeThemeGui = script.Parent.Value
  1302.  
  1303. while wait(2) do
  1304. if UsedRakeThemeGui then
  1305. Config.RakeThemeVolume = 0
  1306. Config.FoundVolume = 0
  1307. Config.StaticSoundVolume = 0
  1308. end
  1309. end end;
  1310. function() -- Script by XcorrectTheDev
  1311.  
  1312. script.Parent.Value = script.Parent.Parent.Parent.Head.Static.Volume
  1313. wait(1)
  1314. if script.Parent.Value > 0 then
  1315. script.Parent.Parent.Parent.Head.Static:Play()
  1316. end end;
  1317. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1318. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1319. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1320.  
  1321. --[[ INSTRUCTIONS
  1322. - Place in the model
  1323. - Make sure model is anchored
  1324. - That's it. It will weld the model and all children.
  1325.  
  1326. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1327. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1328. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1329. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1330. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1331. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1332. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1333. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1334.  
  1335. 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.
  1336. ]]
  1337.  
  1338. --[[ DOCUMENTATION
  1339. - 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.
  1340. - Will work in PBS servers
  1341. - Will work as long as it starts out with the part anchored
  1342. - Stores the relative CFrame as a CFrame value
  1343. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1344. - Utilizes a recursive algorith to find all parts in the model
  1345. - Will reweld on script reparent if the script is initially parented to a tool.
  1346. - Welds as fast as possible
  1347. ]]
  1348.  
  1349. -- qPerfectionWeld.lua
  1350. -- Created 10/6/2014
  1351. -- Author: Quenty
  1352. -- Version 1.0.3
  1353.  
  1354. -- Updated 10/14/2014 - Updated to 1.0.1
  1355. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1356.  
  1357. -- Updated 10/14/2014 - Updated to 1.0.2
  1358. --- Fixed bug fix.
  1359.  
  1360. -- Updated 10/14/2014 - Updated to 1.0.3
  1361. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1362.  
  1363. 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).
  1364.  
  1365.  
  1366. local function CallOnChildren(Instance, FunctionToCall)
  1367. -- Calls a function on each of the children of a certain object, using recursion.
  1368.  
  1369. FunctionToCall(Instance)
  1370.  
  1371. for _, Child in next, Instance:GetChildren() do
  1372. CallOnChildren(Child, FunctionToCall)
  1373. end
  1374. end
  1375.  
  1376. local function GetNearestParent(Instance, ClassName)
  1377. -- Returns the nearest parent of a certain class, or returns nil
  1378.  
  1379. local Ancestor = Instance
  1380. repeat
  1381. Ancestor = Ancestor.Parent
  1382. if Ancestor == nil then
  1383. return nil
  1384. end
  1385. until Ancestor:IsA(ClassName)
  1386.  
  1387. return Ancestor
  1388. end
  1389.  
  1390. local function GetBricks(StartInstance)
  1391. local List = {}
  1392.  
  1393. -- if StartInstance:IsA("BasePart") then
  1394. -- List[#List+1] = StartInstance
  1395. -- end
  1396.  
  1397. CallOnChildren(StartInstance, function(Item)
  1398. if Item:IsA("BasePart") then
  1399. List[#List+1] = Item;
  1400. end
  1401. end)
  1402.  
  1403. return List
  1404. end
  1405.  
  1406. local function Modify(Instance, Values)
  1407. -- Modifies an Instance by using a table.
  1408.  
  1409. assert(type(Values) == "table", "Values is not a table");
  1410.  
  1411. for Index, Value in next, Values do
  1412. if type(Index) == "number" then
  1413. Value.Parent = Instance
  1414. else
  1415. Instance[Index] = Value
  1416. end
  1417. end
  1418. return Instance
  1419. end
  1420.  
  1421. local function Make(ClassType, Properties)
  1422. -- Using a syntax hack to create a nice way to Make new items.
  1423.  
  1424. return Modify(Instance.new(ClassType), Properties)
  1425. end
  1426.  
  1427. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1428. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1429.  
  1430. local function HasWheelJoint(Part)
  1431. for _, SurfaceName in pairs(Surfaces) do
  1432. for _, HingSurfaceName in pairs(HingSurfaces) do
  1433. if Part[SurfaceName].Name == HingSurfaceName then
  1434. return true
  1435. end
  1436. end
  1437. end
  1438.  
  1439. return false
  1440. end
  1441.  
  1442. local function ShouldBreakJoints(Part)
  1443. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1444. -- definitely some edge cases.
  1445.  
  1446. if NEVER_BREAK_JOINTS then
  1447. return false
  1448. end
  1449.  
  1450. if HasWheelJoint(Part) then
  1451. return false
  1452. end
  1453.  
  1454. local Connected = Part:GetConnectedParts()
  1455.  
  1456. if #Connected == 1 then
  1457. return false
  1458. end
  1459.  
  1460. for _, Item in pairs(Connected) do
  1461. if HasWheelJoint(Item) then
  1462. return false
  1463. elseif not Item:IsDescendantOf(script.Parent) then
  1464. return false
  1465. end
  1466. end
  1467.  
  1468. return true
  1469. end
  1470.  
  1471. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1472. --- Weld's 2 parts together
  1473. -- @param Part0 The first part
  1474. -- @param Part1 The second part (Dependent part most of the time).
  1475. -- @param [JointType] The type of joint. Defaults to weld.
  1476. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1477. -- @return The weld created.
  1478.  
  1479. JointType = JointType or "Weld"
  1480. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1481.  
  1482. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1483. Modify(NewWeld, {
  1484. Name = "qCFrameWeldThingy";
  1485. Part0 = Part0;
  1486. Part1 = Part1;
  1487. C0 = CFrame.new();--Part0.CFrame:inverse();
  1488. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1489. Parent = Part1;
  1490. })
  1491.  
  1492. if not RelativeValue then
  1493. RelativeValue = Make("CFrameValue", {
  1494. Parent = Part1;
  1495. Name = "qRelativeCFrameWeldValue";
  1496. Archivable = true;
  1497. Value = NewWeld.C1;
  1498. })
  1499. end
  1500.  
  1501. return NewWeld
  1502. end
  1503.  
  1504. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1505. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1506. -- @param MainPart The part to weld the model to (can be in the model).
  1507. -- @param [JointType] The type of joint. Defaults to weld.
  1508. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1509.  
  1510. for _, Part in pairs(Parts) do
  1511. if ShouldBreakJoints(Part) then
  1512. Part:BreakJoints()
  1513. end
  1514. end
  1515.  
  1516. for _, Part in pairs(Parts) do
  1517. if Part ~= MainPart then
  1518. WeldTogether(MainPart, Part, JointType, MainPart)
  1519. end
  1520. end
  1521.  
  1522. if not DoNotUnanchor then
  1523. for _, Part in pairs(Parts) do
  1524. Part.Anchored = false
  1525. end
  1526. MainPart.Anchored = false
  1527. end
  1528. end
  1529.  
  1530. local function PerfectionWeld()
  1531. local Tool = GetNearestParent(script, "Tool")
  1532.  
  1533. local Parts = GetBricks(script.Parent)
  1534. 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]
  1535.  
  1536. if PrimaryPart then
  1537. WeldParts(Parts, PrimaryPart, "Weld", false)
  1538. else
  1539. warn("qWeld - Unable to weld part")
  1540. end
  1541.  
  1542. return Tool
  1543. end
  1544.  
  1545. local Tool = PerfectionWeld()
  1546.  
  1547.  
  1548. if Tool and script.ClassName == "Script" then
  1549. --- Don't bother with local scripts
  1550.  
  1551. script.Parent.AncestryChanged:connect(function()
  1552. PerfectionWeld()
  1553. end)
  1554. end
  1555.  
  1556. -- Created by Quenty (@Quenty, follow me on twitter).
  1557. end;
  1558. function() -- Script by XcorrectTheDev
  1559.  
  1560. while wait(10) do
  1561. script.Parent.NPC.PlatformStand = false
  1562. script.Parent.Torso.Anchored = false
  1563. end end;
  1564. function() -- Doesn't provide rake animations
  1565.  
  1566. function waitForChild(parent, childName)
  1567. local child = parent:findFirstChild(childName)
  1568. if child then return child end
  1569. while true do
  1570. child = parent.ChildAdded:wait()
  1571. if child.Name == childName then return child end
  1572. end
  1573. end
  1574. local Figure = script.Parent
  1575. local Torso = waitForChild(Figure, "Torso")
  1576. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  1577. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  1578. local RightHip = waitForChild(Torso, "Right Hip")
  1579. local LeftHip = waitForChild(Torso, "Left Hip")
  1580. local Neck = waitForChild(Torso, "Neck")
  1581. local Humanoid;
  1582. for _,Child in pairs(Figure:GetChildren())do
  1583. if Child and Child.ClassName == "Humanoid"then
  1584. Humanoid = Child;
  1585. end;
  1586. end;
  1587. local pose = "Standing"
  1588. local currentAnim = ""
  1589. local currentAnimInstance = nil
  1590. local currentAnimTrack = nil
  1591. local currentAnimKeyframeHandler = nil
  1592. local currentAnimSpeed = 1.0
  1593. local animTable = {}
  1594. local animNames = {
  1595. idle = {
  1596. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  1597. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  1598. },
  1599. walk = {
  1600. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  1601. },
  1602. run = {
  1603. { id = "http://www.roblox.com/asset/?id=252557606", weight = 20 }
  1604. },
  1605. jump = {
  1606. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  1607. },
  1608. fall = {
  1609. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  1610. },
  1611. climb = {
  1612. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  1613. },
  1614. sit = {
  1615. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  1616. },
  1617. toolnone = {
  1618. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  1619. },
  1620. toolslash = {
  1621. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  1622.  
  1623. },
  1624. toollunge = {
  1625. { id = "http://www.roblox.com/asset/?id=0", weight = 10 }
  1626. },
  1627. wave = {
  1628. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  1629. },
  1630. point = {
  1631. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  1632. },
  1633. dance1 = {
  1634. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  1635. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  1636. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  1637. },
  1638. dance2 = {
  1639. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  1640. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  1641. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  1642. },
  1643. dance3 = {
  1644. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1645. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1646. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1647. },
  1648. laugh = {
  1649. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1650. },
  1651. cheer = {
  1652. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1653. },
  1654. }
  1655. local dances = {"dance1", "dance2", "dance3"}
  1656.  
  1657. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1658.  
  1659. function configureAnimationSet(name, fileList)
  1660. if (animTable[name] ~= nil) then
  1661. for _, connection in pairs(animTable[name].connections) do
  1662. connection:disconnect()
  1663. end
  1664. end
  1665. animTable[name] = {}
  1666. animTable[name].count = 0
  1667. animTable[name].totalWeight = 0
  1668. animTable[name].connections = {}
  1669.  
  1670.  
  1671. local config = script:FindFirstChild(name)
  1672. if (config ~= nil) then
  1673.  
  1674. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1675. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1676. local idx = 1
  1677. for _, childPart in pairs(config:GetChildren()) do
  1678. if (childPart:IsA("Animation")) then
  1679. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1680. animTable[name][idx] = {}
  1681. animTable[name][idx].anim = childPart
  1682. local weightObject = childPart:FindFirstChild("Weight")
  1683. if (weightObject == nil) then
  1684. animTable[name][idx].weight = 1
  1685. else
  1686. animTable[name][idx].weight = weightObject.Value
  1687. end
  1688. animTable[name].count = animTable[name].count + 1
  1689. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1690.  
  1691. idx = idx + 1
  1692. end
  1693. end
  1694. end
  1695.  
  1696.  
  1697. if (animTable[name].count <= 0) then
  1698. for idx, anim in pairs(fileList) do
  1699. animTable[name][idx] = {}
  1700. animTable[name][idx].anim = Instance.new("Animation")
  1701. animTable[name][idx].anim.Name = name
  1702. animTable[name][idx].anim.AnimationId = anim.id
  1703. animTable[name][idx].weight = anim.weight
  1704. animTable[name].count = animTable[name].count + 1
  1705. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1706.  
  1707. end
  1708. end
  1709. end
  1710.  
  1711.  
  1712. function scriptChildModified(child)
  1713. local fileList = animNames[child.Name]
  1714. if (fileList ~= nil) then
  1715. configureAnimationSet(child.Name, fileList)
  1716. end
  1717. end
  1718.  
  1719. script.ChildAdded:connect(scriptChildModified)
  1720. script.ChildRemoved:connect(scriptChildModified)
  1721.  
  1722.  
  1723. for name, fileList in pairs(animNames) do
  1724. configureAnimationSet(name, fileList)
  1725. end
  1726.  
  1727.  
  1728. local toolAnim = "None"
  1729. local toolAnimTime = 0
  1730.  
  1731. local jumpAnimTime = 0
  1732. local jumpAnimDuration = 0.3
  1733.  
  1734. local toolTransitionTime = 0.1
  1735. local fallTransitionTime = 0.3
  1736. local jumpMaxLimbVelocity = 0.75
  1737.  
  1738.  
  1739.  
  1740. function stopAllAnimations()
  1741. local oldAnim = currentAnim
  1742.  
  1743.  
  1744. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1745. oldAnim = "idle"
  1746. end
  1747.  
  1748. currentAnim = ""
  1749. currentAnimInstance = nil
  1750. if (currentAnimKeyframeHandler ~= nil) then
  1751. currentAnimKeyframeHandler:disconnect()
  1752. end
  1753.  
  1754. if (currentAnimTrack ~= nil) then
  1755. currentAnimTrack:Stop()
  1756. currentAnimTrack:Destroy()
  1757. currentAnimTrack = nil
  1758. end
  1759. return oldAnim
  1760. end
  1761.  
  1762. function setAnimationSpeed(speed)
  1763. if speed ~= currentAnimSpeed then
  1764. currentAnimSpeed = speed
  1765. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1766. end
  1767. end
  1768.  
  1769. function keyFrameReachedFunc(frameName)
  1770. if (frameName == "End") then
  1771.  
  1772. local repeatAnim = currentAnim
  1773.  
  1774. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1775. repeatAnim = "idle"
  1776. end
  1777.  
  1778. local animSpeed = currentAnimSpeed
  1779. playAnimation(repeatAnim, 0.0, Humanoid)
  1780. setAnimationSpeed(animSpeed)
  1781. end
  1782. end
  1783.  
  1784.  
  1785. function playAnimation(animName, transitionTime, humanoid)
  1786.  
  1787. local roll = math.random(1, animTable[animName].totalWeight)
  1788. local origRoll = roll
  1789. local idx = 1
  1790. while (roll > animTable[animName][idx].weight) do
  1791. roll = roll - animTable[animName][idx].weight
  1792. idx = idx + 1
  1793. end
  1794.  
  1795. local anim = animTable[animName][idx].anim
  1796.  
  1797. if (anim ~= currentAnimInstance) then
  1798. if (currentAnimTrack ~= nil) then
  1799. currentAnimTrack:Stop(transitionTime)
  1800. currentAnimTrack:Destroy()
  1801. end
  1802. currentAnimSpeed = 1.0
  1803.  
  1804. currentAnimTrack = humanoid:LoadAnimation(anim)
  1805.  
  1806. currentAnimTrack:Play(transitionTime)
  1807. currentAnim = animName
  1808. currentAnimInstance = anim
  1809.  
  1810. if (currentAnimKeyframeHandler ~= nil) then
  1811. currentAnimKeyframeHandler:disconnect()
  1812. end
  1813. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1814. end
  1815. end
  1816.  
  1817. local toolAnimName = ""
  1818. local toolAnimTrack = nil
  1819. local toolAnimInstance = nil
  1820. local currentToolAnimKeyframeHandler = nil
  1821. function toolKeyFrameReachedFunc(frameName)
  1822. if (frameName == "End") then
  1823.  
  1824. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1825. end
  1826. end
  1827. function playToolAnimation(animName, transitionTime, humanoid)
  1828. local roll = math.random(1, animTable[animName].totalWeight)
  1829. local origRoll = roll
  1830. local idx = 1
  1831. while (roll > animTable[animName][idx].weight) do
  1832. roll = roll - animTable[animName][idx].weight
  1833. idx = idx + 1
  1834. end
  1835.  
  1836. local anim = animTable[animName][idx].anim
  1837. if (toolAnimInstance ~= anim) then
  1838. if (toolAnimTrack ~= nil) then
  1839. toolAnimTrack:Stop()
  1840. toolAnimTrack:Destroy()
  1841. transitionTime = 0
  1842. end
  1843.  
  1844. toolAnimTrack = humanoid:LoadAnimation(anim)
  1845.  
  1846. toolAnimTrack:Play(transitionTime)
  1847. toolAnimName = animName
  1848. toolAnimInstance = anim
  1849. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1850. end
  1851. end
  1852. function stopToolAnimations()
  1853. local oldAnim = toolAnimName
  1854. if (currentToolAnimKeyframeHandler ~= nil) then
  1855. currentToolAnimKeyframeHandler:disconnect()
  1856. end
  1857. toolAnimName = ""
  1858. toolAnimInstance = nil
  1859. if (toolAnimTrack ~= nil) then
  1860. toolAnimTrack:Stop()
  1861. toolAnimTrack:Destroy()
  1862. toolAnimTrack = nil
  1863. end
  1864. return oldAnim
  1865. end
  1866.  
  1867. function onRunning(speed)
  1868. if speed>0.01 then
  1869. if Figure and Humanoid and Humanoid.WalkSpeed<17 then
  1870. playAnimation("walk", 0.1, Humanoid);
  1871. elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
  1872. playAnimation("run", 0.1, Humanoid);
  1873. end;
  1874. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1875. setAnimationSpeed(speed / 14.5)
  1876. end
  1877. pose = "Running"
  1878. else
  1879. playAnimation("idle", 0.1, Humanoid)
  1880. pose = "Standing"
  1881. end
  1882. end
  1883. function onDied()
  1884. pose = "Dead"
  1885. end
  1886. function onJumping()
  1887. playAnimation("jump", 0.1, Humanoid)
  1888. jumpAnimTime = jumpAnimDuration
  1889. pose = "Jumping"
  1890. end
  1891. function onClimbing(speed)
  1892. playAnimation("climb", 0.1, Humanoid)
  1893. setAnimationSpeed(speed / 12.0)
  1894. pose = "Climbing"
  1895. end
  1896. function onGettingUp()
  1897. pose = "GettingUp"
  1898. end
  1899. function onFreeFall()
  1900. if (jumpAnimTime <= 0) then
  1901. playAnimation("fall", fallTransitionTime, Humanoid)
  1902. end
  1903. pose = "FreeFall"
  1904. end
  1905. function onFallingDown()
  1906. pose = "FallingDown"
  1907. end
  1908. function onSeated()
  1909. pose = "Seated"
  1910. end
  1911. function onPlatformStanding()
  1912. pose = "PlatformStanding"
  1913. end
  1914. function onSwimming(speed)
  1915. if speed>0 then
  1916. pose = "Running"
  1917. else
  1918. pose = "Standing"
  1919. end
  1920. end
  1921.  
  1922. function getTool()
  1923. for _, kid in ipairs(Figure:GetChildren()) do
  1924. if kid.className == "Tool" then return kid end
  1925. end
  1926. return nil
  1927. end
  1928.  
  1929. function getToolAnim(tool)
  1930. for _, c in ipairs(tool:GetChildren()) do
  1931. if c.Name == "toolanim" and c.className == "StringValue" then
  1932. return c
  1933. end
  1934. end
  1935. return nil
  1936. end
  1937.  
  1938. function animateTool()
  1939.  
  1940. if (toolAnim == "None") then
  1941. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1942. return
  1943. end
  1944.  
  1945. if (toolAnim == "Slash") then
  1946. playToolAnimation("toolslash", 0, Humanoid)
  1947. return
  1948. end
  1949.  
  1950. if (toolAnim == "Lunge") then
  1951. playToolAnimation("toollunge", 0, Humanoid)
  1952. return
  1953. end
  1954. end
  1955.  
  1956. function moveSit()
  1957. RightShoulder.MaxVelocity = 0.15
  1958. LeftShoulder.MaxVelocity = 0.15
  1959. RightShoulder:SetDesiredAngle(3.14 /2)
  1960. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1961. RightHip:SetDesiredAngle(3.14 /2)
  1962. LeftHip:SetDesiredAngle(-3.14 /2)
  1963. end
  1964.  
  1965. local lastTick = 0
  1966.  
  1967. function move(time)
  1968. local amplitude = 1
  1969. local frequency = 1
  1970. local deltaTime = time - lastTick
  1971. lastTick = time
  1972.  
  1973. local climbFudge = 0
  1974. local setAngles = false
  1975.  
  1976. if (jumpAnimTime > 0) then
  1977. jumpAnimTime = jumpAnimTime - deltaTime
  1978. end
  1979.  
  1980. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1981. playAnimation("fall", fallTransitionTime, Humanoid)
  1982. elseif (pose == "Seated") then
  1983. playAnimation("sit", 0.5, Humanoid)
  1984. return
  1985. elseif (pose == "Running") then
  1986. if Figure and Humanoid and Humanoid.WalkSpeed<17 then
  1987. playAnimation("walk", 0.1, Humanoid);
  1988. elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
  1989. playAnimation("run", 0.1, Humanoid);
  1990. end;
  1991. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1992. stopAllAnimations()
  1993. amplitude = 0.1
  1994. frequency = 1
  1995. setAngles = true
  1996. end
  1997. if (setAngles) then
  1998. local desiredAngle = amplitude * math.sin(time * frequency)
  1999. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  2000. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  2001. RightHip:SetDesiredAngle(-desiredAngle)
  2002. LeftHip:SetDesiredAngle(-desiredAngle)
  2003. end
  2004.  
  2005. local tool = getTool()
  2006. if tool and tool:FindFirstChild("Handle") then
  2007. local animStringValueObject = getToolAnim(tool)
  2008. if animStringValueObject then
  2009. toolAnim = animStringValueObject.Value
  2010.  
  2011. animStringValueObject.Parent = nil
  2012. toolAnimTime = time + .3
  2013. end
  2014. if time > toolAnimTime then
  2015. toolAnimTime = 0
  2016. toolAnim = "None"
  2017. end
  2018. animateTool()
  2019. else
  2020. stopToolAnimations()
  2021. toolAnim = "None"
  2022. toolAnimInstance = nil
  2023. toolAnimTime = 0
  2024. end
  2025. end
  2026.  
  2027. Humanoid.Died:Connect(onDied)
  2028. Humanoid.Running:Connect(onRunning)
  2029. Humanoid.Jumping:Connect(onJumping)
  2030. Humanoid.Climbing:Connect(onClimbing)
  2031. Humanoid.GettingUp:Connect(onGettingUp)
  2032. Humanoid.FreeFalling:Connect(onFreeFall)
  2033. Humanoid.FallingDown:Connect(onFallingDown)
  2034. Humanoid.Seated:Connect(onSeated)
  2035. Humanoid.PlatformStanding:Connect(onPlatformStanding)
  2036. Humanoid.Swimming:Connect(onSwimming)
  2037. local runService = game:GetService("RunService");
  2038. playAnimation("idle", 0.1, Humanoid)
  2039. pose = "Standing"
  2040. while true do
  2041. local _,time = wait(0)
  2042. move(time)
  2043. end end;
  2044. function() --[[
  2045. CREDITs
  2046.  
  2047. Thanks RVVZ for original base rake model :)
  2048. Model insired by RVVZ
  2049. Animation Scripted by ROBLOX (I'm not sure who is scripted this lol)
  2050. MainScript Scriped by Brutez script fixed by XcorrectTheDev
  2051. Respawn Scriped by Brutez Script Fixed By XcorrectTheDev
  2052. qPerfectionWeld Scripted by Quenty
  2053. Other scripts Scriped by XcorrectTheDev
  2054.  
  2055.  
  2056. ]]
  2057. end;
  2058. function() --[[ Script By: Brutez. Script Fixed By XcorrectTheDev ]]--
  2059.  
  2060. local PlayerSpawning=false; -- Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position.
  2061. local AdvancedRespawnScript=script;
  2062. repeat wait(0.1) until script and script.Parent and script.Parent.ClassName=="Model";
  2063. local JeffTheKiller=AdvancedRespawnScript.Parent;
  2064. local GameDerbis=game:GetService("Debris");
  2065. local JeffTheKillerHumanoid;
  2066. for _,Child in pairs(JeffTheKiller:GetChildren())do
  2067. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  2068. JeffTheKillerHumanoid=Child;
  2069. end;
  2070. end;
  2071. local Respawndant=JeffTheKiller:Clone();
  2072. if PlayerSpawning then -- LOOK AT LINE: 2.
  2073. coroutine.resume(coroutine.create(function()
  2074. if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
  2075. SpawnModel=Instance.new("Model");
  2076. SpawnModel.Parent=JeffTheKillerHumanoid.Status;
  2077. SpawnModel.Name="AvalibleSpawns";
  2078. else
  2079. SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
  2080. end;
  2081. function FindSpawn(SearchValue)
  2082. local PartsArchivable=SearchValue:GetChildren();
  2083. for AreaSearch=1,#PartsArchivable do
  2084. if PartsArchivable[AreaSearch].className=="SpawnLocation"then
  2085. local PositionValue=Instance.new("Vector3Value",SpawnModel);
  2086. PositionValue.Value=PartsArchivable[AreaSearch].Position;
  2087. PositionValue.Name=PartsArchivable[AreaSearch].Duration;
  2088. end;
  2089. FindSpawn(PartsArchivable[AreaSearch]);
  2090. end;
  2091. end;
  2092. FindSpawn(game:GetService("Workspace"));
  2093. local SpawnChilden=SpawnModel:GetChildren();
  2094. if#SpawnChilden>0 then
  2095. local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
  2096. local RespawningForceField=Instance.new("ForceField");
  2097. RespawningForceField.Parent=JeffTheKiller;
  2098. RespawningForceField.Name="SpawnForceField";
  2099. GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
  2100. JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
  2101. else
  2102. if JeffTheKiller:FindFirstChild("SpawnForceField")then
  2103. JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
  2104. end;
  2105. JeffTheKiller:MoveTo(Vector3.new(0,115,0));
  2106. end;
  2107. end));
  2108. end;
  2109. function Respawn()
  2110. wait(10);
  2111. Respawndant.Parent=JeffTheKiller.Parent;
  2112. Respawndant:makeJoints();
  2113. Respawndant:FindFirstChild("Head"):MakeJoints();
  2114. Respawndant:FindFirstChild("Torso"):MakeJoints();
  2115. JeffTheKiller:remove();
  2116. end;
  2117. if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
  2118. JeffTheKillerHumanoid.Died:Connect(Respawn);
  2119. end; end;
  2120. function() -- Script by XcorrectTheDev
  2121.  
  2122. local AlreadyStun = false
  2123.  
  2124. while wait(0.1) do
  2125. if AlreadyStun then
  2126. script.Parent.NPC.WalkSpeed = 0
  2127. end
  2128. if script.Parent.NPC.Health < 1940 and not AlreadyStun then
  2129. AlreadyStun = true
  2130. script.Parent.MainScript.Disabled = true
  2131. script.Parent.NPC.PlatformStand = true
  2132. script.Parent.Head.Static:Stop()
  2133. wait(0.5)
  2134. local RandomSound = math.random(1,3)
  2135. if RandomSound == 1 then
  2136. script.Parent.Head.RakeHurt:Play()
  2137. end
  2138. if RandomSound == 2 then
  2139. script.Parent.Head.RakeHurt2:Play()
  2140. end
  2141. if RandomSound == 3 then
  2142. script.Parent.Head.RakeHurt3:Play()
  2143. end
  2144. script.Parent:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0)
  2145. script.GetStuns.Value = script.GetStuns.Value + 1
  2146. script.Parent.Torso.Swing:Stop()
  2147. script.Parent.Torso.HitBox.DamageScript.Disabled = true
  2148. script.Parent.Head.RakeTheme:Stop()
  2149. script.Parent.NPC.WalkSpeed = 0
  2150. wait(script.Parent.Configuration.StunTime.Value)
  2151. print("The rake stun ".. script.GetStuns.Value.. " Times")
  2152. script.Parent.NPC.PlatformStand = false
  2153. script.Parent.Torso.Swing:Stop()
  2154. script.Parent.Torso.HitBox.DamageScript.Disabled = false
  2155. script.Parent.NPC.Health = 2000
  2156. script.Parent.NPC.WalkSpeed = script.Parent.Configuration.WalkSpeed.Value
  2157. script.Parent.MainScript.Disabled = false
  2158. if script.Parent.Configuration.StaticSoundVolume > 0 then
  2159. script.Parent.Head.Static:Play()
  2160. end
  2161. wait(script.Parent.Configuration.StunReload.Value)
  2162. AlreadyStun = false
  2163. end
  2164. end end;
  2165. function() -- Script by XcorrectTheDev
  2166.  
  2167. while true do
  2168. script.Parent.NPC:MoveTo(Vector3.new(math.random(-820, 840),
  2169. 0, math.random(-820, 840)), game.Workspace.Terrain)
  2170. for i= 1,10 do
  2171. wait(0.5)
  2172. script.Parent.Head.RakeStep:Play()
  2173. end
  2174. wait(5)
  2175. end end;
  2176. function() --[[ Script by XcorrectTheDev
  2177. Put this script in StarterGui (Don't ungroup the gui)
  2178. This script will make screen shake when you near the rake ]]
  2179.  
  2180. repeat
  2181. script.RakeTheme.Parent = script.Parent
  2182. until
  2183. script.Parent:FindFirstChild("RakeTheme")
  2184. script.Parent:FindFirstChild("RakeTheme").Main.Disabled = false
  2185. wait(1)
  2186. script:Destroy() end;
  2187. function() -- Script by XcorrectTheDev
  2188.  
  2189. local Character = game.Players.LocalPlayer.Character
  2190. local RakeTheme = script.Parent.Theme
  2191. local NearTheme = script.Parent.GetNear
  2192. local Found = script.Parent.Found
  2193. local FlashEffect = script.Parent.FlashEffect
  2194. local ScreenShake = script.Parent.ScreenShake
  2195. local NightTheme = script.Parent.NightTheme
  2196. local Rake = workspace.The_Rake.HumanoidRootPart
  2197. local Camera = workspace.Camera
  2198. local Debounce1 = false
  2199. local Debounce2 = false
  2200.  
  2201. NightTheme:Play()
  2202.  
  2203. -- Better don't change anything. This script is WIP v.0.2
  2204. -- This screen gui doesn't work if your game has day and night loop
  2205.  
  2206. game:GetService("RunService").RenderStepped:Connect(function()
  2207. if (Rake.Position - Character.HumanoidRootPart.Position).magnitude<70 and Debounce1 == false then
  2208. Debounce1 = true
  2209. NightTheme:Pause()
  2210. Found:Play()
  2211. FlashEffect.BackgroundTransparency = 0.6
  2212. wait(0.4)
  2213. ScreenShake.Disabled = false
  2214. FlashEffect.BackgroundTransparency = 1
  2215. RakeTheme:Play()
  2216. end
  2217. if (Rake.Position - Character.HumanoidRootPart.Position).magnitude>70 and Debounce1 == true then
  2218. Debounce1 = false
  2219. NightTheme:Play()
  2220. ScreenShake.Disabled = true
  2221. FlashEffect.BackgroundTransparency = 1
  2222. RakeTheme:Stop()
  2223. end
  2224. end)
  2225. end;
  2226. function() -- Script by XcorrectTheDev
  2227.  
  2228. local Theme = script.Parent.Theme
  2229. local FlashEffect = script.Parent.FlashEffect
  2230. local Camera = workspace.Camera
  2231. local ScreenZoomAmount = 0.025 -- How much screen zoom when music is playing
  2232. local FlashAmount = 0.001 -- How much screen flash when music is playing
  2233. local ScreenAngelsAmount = 0.003 -- How much screen angles change when music is playing
  2234. local StandardFieldOfView = 70 -- Standard FieldOfView on roblox better set it to 70
  2235.  
  2236. game:GetService("RunService").RenderStepped:Connect(function()
  2237. Camera.FieldOfView = StandardFieldOfView - Theme.PlaybackLoudness * ScreenZoomAmount
  2238. FlashEffect.BackgroundTransparency = 1 - Theme.PlaybackLoudness * FlashAmount
  2239. Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(0,
  2240. 0, math.rad(math.random(- Theme.PlaybackLoudness,
  2241. Theme.PlaybackLoudness) * ScreenAngelsAmount)) + Vector3.new(
  2242. math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
  2243. Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
  2244. math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
  2245. Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
  2246. math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
  2247. Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount )
  2248. )
  2249. end)
  2250. end;
  2251. function() --[[ Script By: Brutez. Script Fixed By XcorrectTheDev ]]--
  2252.  
  2253. local JeffTheKillerScript=script;
  2254. repeat wait(0.1)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
  2255. local JeffTheKiller=JeffTheKillerScript.Parent;
  2256. function raycast(Spos,vec,currentdist)
  2257. local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
  2258. if hit2~=nil and pos2 then
  2259. if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
  2260. local currentdist=currentdist-(pos2-Spos).magnitude;
  2261. return raycast(pos2,vec,currentdist);
  2262. end;
  2263. end;
  2264. return hit2,pos2;
  2265. end;
  2266. function RayCast(Position,Direction,MaxDistance,IgnoreList)
  2267. return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
  2268. end;
  2269. local JeffTheKillerHumanoid;
  2270. for _,Child in pairs(JeffTheKiller:GetChildren())do
  2271. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  2272. JeffTheKillerHumanoid=Child;
  2273. end;
  2274. end;
  2275. local AttackDebounce=false;
  2276. local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Torso");
  2277. local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
  2278. local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
  2279. local WalkDebounce=false;
  2280. local Notice=false;
  2281. local JeffLaughDebounce=false;
  2282. local MusicDebounce=false;
  2283. local NoticeDebounce=false;
  2284. local ChosenMusic;
  2285. JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
  2286. local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
  2287. function FindNearestBae()
  2288. local NoticeDistance=70;
  2289. local TargetMain;
  2290. for _,TargetModel in pairs(game:GetService("Workspace"):GetChildren())do
  2291. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
  2292. local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
  2293. local FoundHumanoid;
  2294. for _,Child in pairs(TargetModel:GetChildren())do
  2295. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  2296. FoundHumanoid=Child;
  2297. end;
  2298. end;
  2299. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
  2300. TargetMain=TargetPart;
  2301. NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
  2302. local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500);
  2303. if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Head")and hit.Parent:FindFirstChildOfClass("Humanoid") then
  2304. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 and not AttackDebounce then
  2305. spawn(function()
  2306. AttackDebounce=true;
  2307. local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
  2308. local SwingChoice=math.random(1,2);
  2309. local HitChoice=math.random(1,3);
  2310. SwingAnimation:Play();
  2311. SwingAnimation:AdjustSpeed(2+(math.random()*0.2));
  2312. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
  2313. local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
  2314. SwingSound.Pitch=1+(math.random()*0.04);
  2315. SwingSound:Play();
  2316. end;
  2317. wait(1.2);
  2318. AttackDebounce=false;
  2319. end);
  2320. end;
  2321. end;
  2322. end;
  2323. end;
  2324. end;
  2325. return TargetMain;
  2326. end;
  2327. while wait(0.1)do
  2328. local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
  2329. local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
  2330. local Jumpable=false;
  2331. if Blockage then
  2332. wait(0.5)
  2333. Jumpable=true;
  2334. if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
  2335. local BlockageHumanoid;
  2336. for _,Child in pairs(Blockage.Parent:GetChildren())do
  2337. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  2338. BlockageHumanoid=Child;
  2339. Jumpable=false;
  2340. end;
  2341. end;
  2342. if Blockage and Blockage:IsA("Terrain")then
  2343. local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
  2344. local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
  2345. if CellMaterial==Enum.CellMaterial.Water then
  2346. Jumpable=false;
  2347. end;
  2348. elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool" or Blockage.Parent.Name=="Humanoid" and Blockage.Parent.Name=="HumanoidRootPart" and Blockage.Parent.ClassName=="Humanoid" then
  2349. Jumpable=false;
  2350. end;
  2351. end;
  2352. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
  2353. JeffTheKillerHumanoid.Jump=true;
  2354. end;
  2355. end;
  2356. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("RakeStep")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  2357. spawn(function()
  2358. WalkDebounce=true;
  2359. local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
  2360. local RayTarget,endPoint=game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
  2361. if RayTarget then
  2362. local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("RakeStep"):Clone();
  2363. JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
  2364. JeffTheKillerHeadFootStepClone:Play();
  2365. JeffTheKillerHeadFootStepClone:Destroy();
  2366. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
  2367. wait(0.4);
  2368. elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
  2369. wait(0.15);
  2370. end
  2371. end;
  2372. WalkDebounce=false;
  2373. end);
  2374. end;
  2375. local MainTarget=FindNearestBae();
  2376. local FoundHumanoid;
  2377. if MainTarget then
  2378. for _,Child in pairs(MainTarget.Parent:GetChildren())do
  2379. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  2380. FoundHumanoid=Child;
  2381. end;
  2382. end;
  2383. end;
  2384. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<99999999999999999999 then
  2385. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and not JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
  2386. JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RakeThemeVolume").Value;
  2387. JeffTheKillerHead:FindFirstChild("RakeTheme"):Play();
  2388. end;
  2389. elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>9999999999999999999 then
  2390. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
  2391. if not JeffLaughDebounce then
  2392. spawn(function()
  2393. JeffLaughDebounce=true;
  2394. repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
  2395. JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
  2396. JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
  2397. JeffLaughDebounce=false;
  2398. end);
  2399. end;
  2400. end;
  2401. end;
  2402. if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
  2403. local MusicChoice=math.random(1,2);
  2404. if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
  2405. ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
  2406. elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
  2407. ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
  2408. end;
  2409. if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
  2410. ChosenMusic.Volume=0;
  2411. ChosenMusic:Play();
  2412. end;
  2413. elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
  2414. if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
  2415. if not MusicDebounce then
  2416. spawn(function()
  2417. MusicDebounce=true;
  2418. repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
  2419. if ChosenMusic then
  2420. ChosenMusic.Volume=0;
  2421. ChosenMusic:Stop();
  2422. end;
  2423. ChosenMusic=nil;
  2424. MusicDebounce=false;
  2425. end);
  2426. end;
  2427. end;
  2428. end;
  2429. if not MainTarget and not JeffLaughDebounce then
  2430. spawn(function()
  2431. JeffLaughDebounce=true;
  2432. repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
  2433. JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
  2434. JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
  2435. JeffLaughDebounce=false;
  2436. end);
  2437. end;
  2438. if not MainTarget and not MusicDebounce then
  2439. spawn(function()
  2440. MusicDebounce=true;
  2441. repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
  2442. if ChosenMusic then
  2443. ChosenMusic.Volume=0;
  2444. ChosenMusic:Stop();
  2445. end;
  2446. ChosenMusic=nil;
  2447. MusicDebounce=false;
  2448. end);
  2449. end;
  2450. if MainTarget then
  2451. Notice=true;
  2452. if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Found")then
  2453. JeffTheKiller.Target.Value = true;
  2454. JeffTheKillerHead:FindFirstChild("Found").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("FoundVolume").Value;
  2455. JeffTheKillerHead:FindFirstChild("Found"):Play();
  2456. wait(0.4);
  2457. JeffTheKillerHead:FindFirstChild("RakeScream"):Play();
  2458. NoticeDebounce=true;
  2459. end;
  2460. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  2461. if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
  2462. JeffTheKillerHumanoid.WalkSpeed=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RunSpeed").Value;
  2463. elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
  2464. JeffTheKillerHumanoid.WalkSpeed=2;
  2465. end;
  2466. JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,game:GetService("Workspace"):FindFirstChild("Terrain"));
  2467. local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
  2468. if NeckRotation>-1.5 and NeckRotation<1.5 then
  2469. JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
  2470. end;
  2471. if NeckRotation<-1.5 then
  2472. JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.4,0.1,0,0.1,0.9);
  2473. elseif NeckRotation>1.5 then
  2474. JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.1,0.08,0,0.08,-0.2);
  2475. end;
  2476. else
  2477. end;
  2478. else
  2479. Notice=false;
  2480. NoticeDebounce=false;
  2481. JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
  2482. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  2483. JeffTheKillerHumanoid.WalkSpeed=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("WalkSpeed").Value;
  2484. JeffTheKiller.Target.Value=false;
  2485. end;
  2486. end;
  2487. spawn(function()
  2488. local AlreadyDo=false;
  2489. while wait(0.1) do
  2490. if JeffTheKiller.Target.Value==false and AlreadyDo==false then
  2491. JeffTheKillerHead.Mouth.Transparency=1;
  2492. JeffTheKillerHead.Mouth2.Transparency=0;
  2493. JeffTheKillerHead.Mouth2.MouthDecal.Transparency=0;
  2494. JeffTheKiller.Wander.Disabled=false;
  2495. AlreadyDo=true;
  2496. wait(5);
  2497. AlreadyDo=false;
  2498. end;
  2499. if JeffTheKiller.Target.Value==true and AlreadyDo==false then
  2500. JeffTheKillerHead.Mouth.Transparency=0;
  2501. JeffTheKillerHead.Mouth2.Transparency=1;
  2502. JeffTheKillerHead.Mouth2.MouthDecal.Transparency=1;
  2503. JeffTheKiller.Wander.Disabled=true;
  2504. AlreadyDo=true;
  2505. wait(5);
  2506. AlreadyDo=false;
  2507. end;
  2508. end;
  2509. end);
  2510. spawn(function()
  2511. while JeffTheKillerHumanoid.Health > 1 do
  2512. wait(1);
  2513. JeffTheKiller:FindFirstChild("Torso").Blood.Enabled = false;
  2514. JeffTheKiller:FindFirstChild("Torso").Blood2.Enabled = false;
  2515. JeffTheKillerHead.Eye1.BrickColor=BrickColor.new("Institutional white");
  2516. JeffTheKillerHead.Eye2.BrickColor=BrickColor.new("Institutional white");
  2517. end;
  2518. end);
  2519. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
  2520. JeffTheKillerHumanoid.DisplayDistanceType="None";
  2521. JeffTheKillerHumanoid.HealthDisplayDistance=0;
  2522. JeffTheKillerHumanoid.Name="NPC";
  2523. JeffTheKillerHumanoid.NameDisplayDistance=0;
  2524. JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
  2525. JeffTheKillerHumanoid.AutoJumpEnabled=true;
  2526. JeffTheKillerHumanoid.AutoRotate=true;
  2527. JeffTheKillerHumanoid.MaxHealth=2000;
  2528. JeffTheKillerHumanoid.JumpPower=80;
  2529. JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
  2530. end;
  2531. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
  2532. JeffTheKillerHumanoid.AutoJumpEnabled=true;
  2533. end;
  2534. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
  2535. JeffTheKillerHumanoid.AutoRotate=true;
  2536. end;
  2537. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
  2538. JeffTheKillerHumanoid.PlatformStand=false;
  2539. end;
  2540. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
  2541. JeffTheKillerHumanoid.Sit=false;
  2542. end;
  2543. end; end;}local ActualScripts = {}
  2544. function s(var)
  2545. local func = table.remove(Scripts,1)
  2546. setfenv(func,setmetatable({script=var,require=fake_require or require,global=genv},{
  2547. __index = getfenv(func),
  2548. }))
  2549. table.insert(ActualScripts,coroutine.wrap(func))
  2550. end
  2551. Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  2552. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  2553. function(t,f)
  2554. for a,b in pairs(t) do
  2555. f(a,b)
  2556. end
  2557. end
  2558. local Types = {
  2559. Color3 = Color3.new,
  2560. Vector3 = Vector3.new,
  2561. Vector2 = Vector2.new,
  2562. UDim = UDim.new,
  2563. UDim2 = UDim2.new,
  2564. CFrame = CFrame.new,
  2565. Rect = Rect.new,
  2566. NumberRange = NumberRange.new,
  2567. BrickColor = BrickColor.new,
  2568. PhysicalProperties = PhysicalProperties.new,
  2569. NumberSequence = function(...)
  2570. local a = {...}
  2571. local t = {}
  2572. repeat
  2573. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  2574. until #a==0
  2575. return NumberSequence.new(t)
  2576. end,
  2577. ColorSequence = function(...)
  2578. local a = {...}
  2579. local t = {}
  2580. repeat
  2581. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  2582. until #a==0
  2583. return ColorSequence.new(t)
  2584. end,
  2585. number = tonumber,
  2586. boolean = function(a)
  2587. return a=="1"
  2588. end
  2589. }
  2590. split = function(str,sep)
  2591. if not str then return end
  2592. local fields = {}
  2593. local ConcatNext = false
  2594. str:gsub(("([^%s]+)"):format(sep),function(c)
  2595. if ConcatNext == true then
  2596. fields[#fields] = fields[#fields]..sep..c
  2597. ConcatNext = false
  2598. else
  2599. fields[#fields+1] = c
  2600. end
  2601. if c:sub(#c)=="\\" then
  2602. c = fields[#fields]
  2603. fields[#fields] = c:sub(1,#c-1)
  2604. ConcatNext = true
  2605. end
  2606. end)
  2607. return fields
  2608. end
  2609. RemoveAndSplit = function(t)
  2610. return split(table_remove(t,1),comma)
  2611. end
  2612. t = split(str,";")
  2613. props = RemoveAndSplit(t)
  2614. classes = RemoveAndSplit(t)
  2615. values = split(table_remove(t,1),'|')
  2616. ICList = RemoveAndSplit(t)
  2617. InstanceList = {}
  2618. Model = inst"Model"
  2619. CurPar = Model
  2620. table_foreach(t,function(ct,c)
  2621. if c=="n" or c=="p" then
  2622. CurPar = c=="n" and LastIns or CurPar[parnt]
  2623. else
  2624. ct = split(c,"|")
  2625. local class = classes[tonum(table_remove(ct,1))]
  2626. if class=="UnionOperation" then
  2627. LastIns = {UsePartColor="1"}
  2628. else
  2629. LastIns = inst(class)
  2630. if LastIns:IsA"Script" then
  2631. s(LastIns)
  2632. elseif LastIns:IsA("ModuleScript") then
  2633. ms(LastIns)
  2634. end
  2635. end
  2636.  
  2637. local function SetProperty(LastIns,p,str,s)
  2638. s = Types[typeof(LastIns[p])]
  2639. if p=="CustomPhysicalProperties" then
  2640. s = PhysicalProperties.new
  2641. end
  2642. if s then
  2643. LastIns[p] = s(unpack(split(str,comma)))
  2644. else
  2645. LastIns[p] = str
  2646. end
  2647. end
  2648.  
  2649. local UnionData
  2650. table_foreach(ct,function(s,p,a,str)
  2651. a = p:find":"
  2652. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  2653. if p=="UnionData" then
  2654. UnionData = split(str," ")
  2655. return
  2656. end
  2657. if class=="UnionOperation" then
  2658. LastIns[p] = str
  2659. return
  2660. end
  2661. SetProperty(LastIns,p,str)
  2662. end)
  2663.  
  2664. if UnionData then
  2665. local LI_Data = LastIns
  2666. LastIns = DecodeUnion(UnionData)
  2667. table_foreach(LI_Data,function(p,str)
  2668. SetProperty(LastIns,p,str)
  2669. end)
  2670. end
  2671. table.insert(InstanceList,LastIns)
  2672. LastIns[parnt] = CurPar
  2673. end
  2674. end)
  2675. table_remove(ICList,1)
  2676. table_foreach(ICList,function(a,b)
  2677. b = split(b,">")
  2678. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  2679. end)
  2680.  
  2681. return Model:GetChildren()
  2682. end
  2683.  
  2684. local Objects = Decode('Name,PrimaryPart,Locked,CustomPhysicalProperties,Color,Material,Transparency,Position,Orientation,Size,BackSurface,BottomSurface,FrontSurface,LeftSurface,RightSurface,TopSurface,MaxActivationDistance,'
  2685. ..'MaxDistance,SoundId,Volume,Scale,MeshId,MeshType,CanCollide,Texture,Face,Looped,Enabled,LightInfluence,Speed,Drag,EmissionDirection,Lifetime,Rate,RotSpeed,Rotation,TextureId,StudsPerTileU,StudsPerTile'
  2686. ..'V,MaxVelocity,C0,C1,Part0,Part1,Offset,Value,AnimationId,BodyPart,DisplayDistanceType,HealthDisplayDistance,NameDisplayDistance,NameOcclusion,Health,MaxHealth,JumpPower,MaxSlopeAngle,WalkSpeed,ZIndexB'
  2687. ..'ehavior,BackgroundColor3,BackgroundTransparency,BorderSizePixel,PlaybackSpeed;Part,Model,Script,ClickDetector,Sound,SpecialMesh,MeshPart,Texture,PitchShiftSoundEffect,ParticleEmitter,Motor6D,Decal,Con'
  2688. ..'figuration,IntValue,NumberValue,BoolValue,Animation,CharacterMesh,Humanoid,StringValue,LocalScript,ScreenGui,Frame;Part|siren head|Head|1|0.6999,2,0,1,1|0.3372,0.2588,0.2117|272|-17.4631,14.8287,-40.8'
  2689. ..'89|0,-89.3601,0|6.2958,3.1479,3.1479|10|qPerfectionWeld|0|RakeStep|100|rbxassetid://481147984|1.5|8.3049,8.3049,8.3049|http://www.roblox.com/asset/?id=17392637|5|-16.9469,17.7348,-41.0988|1.32,-89.81,'
  2690. ..'-0.0701|6.9761,9.2461,4.9552|FrontTexture|0.8|rbxassetid://843920074|BackTexture|2|LeftTexture|3|RightTexture|0|TopTexture|1|BottomTexture|4|Found|80|rbxassetid://0|Static|90|rbxassetid://4804675004|1'
  2691. ..'0|RakeHurt3|rbxassetid://4819881245|3|RakeScream|rbxassetid://428391167|3.5|ScreamPitch|RakeTheme|70|RakeHurt|RakeHurt2|Torso|-17.4633,10.1068,-40.8887|6.2958,6.2958,3.1479|HitBox|-12.9793,8.9973,-40.'
  2692. ..'85|0,89.7399,0|5.5366,17.994,11.9037|DamageScript|Bone|-17.433,10.1506,-40.8955|5.9531,6.2051,4.2187|Blood2|0,0,0,1,0.9875,0|0,0.4374,0,1,1,0|rbxassetid://247766282|4,4|2.5|0.5,0.5|30|130,130|180,180|'
  2693. ..'Blood|0,0.6666,0,0,1,0.6666,0,0|0,0.1249,0,1,0.5,0|1,1|40|Swing|60|rbxassetid://148196278|4|Hit|150|rbxassetid://93591808|2|2.7683,2.7683,2.7683|rbxassetid://27111894|rbxassetid://4056053325|MainTextu'
  2694. ..'re|0.7799|Right Shoulder|0.1|3.1479,1.5739,0,0,0,1,0,1,-0,-1,0,0|-1.574,1.5739,0,0,0,1,0,1,-0,-1,0,0|Right Hip|3.1479,-3.148,0,0,0,1,0,1,-0,-1,0,0|1.5739,3.1479,0,0,0,1,0,1,-0,-1,0,0|Left Hip|-3.148,-'
  2695. ..'3.148,0,0,0,-1,0,1,0,1,0,0|-1.574,3.1479,0,0,0,-1,0,1,0,1,0,0|Left Shoulder|-3.148,1.5739,0,0,0,-1,0,1,0,1,0,0|1.5739,1.5739,0,0,0,-1,0,1,0,1,0,0|Neck|0,3.1479,0,-1,0,0,0,0,1,0,1,-0|0,-1.574,0,-1,0,0,'
  2696. ..'0,0,1,0,1,-0|Left Arm|-17.516,10.1064,-45.6103|3.1479,6.2958,3.1479|0,0.6295,0|4.4071,3.7775,4.0923|http://www.roblox.com/asset/?id=36780032|-17.5031,10.7348,-45.6169|3.633,7.4255,2.1395|Left Leg|-17.'
  2697. ..'481,3.8108,-42.4622|rbxassetid://27111857|Right Leg|-17.4459,3.811,-39.3144|rbxassetid://27111882|WalkSpeed|12|Damage|25|StunTime|RakeThemeVolume|AllowToTakeTheModel|TakeThisModelScript|RunSpeed|UsedR'
  2698. ..'akeThemeGui|AutoSet|FoundVolume|5|StunReload|StaticSoundVolume|0.25|VolumeSet|HumanoidRootPart|RootJoint|0,0,0,-1,0,0,0,0,1,0,1,-0|rbxassetid://243827693|27111894|LeftLeg|27111857|RightLeg|27111882|Ta'
  2699. ..'rget|Right Arm|-17.4105,10.1071,-36.1671|rbxassetid://36780156|-17.4137,10.7385,-36.1296|3.6327,7.4259,2.1405|FixAnchored|NPC|2000|89.9|Animation|climb|ClimbAnim|http://www.roblox.com/asset/?id=180436'
  2700. ..'334|fall|FallAnim|http://www.roblox.com/asset/?id=180436148|idle|Animation1|http://www.roblox.com/asset/?id=180435571|Weight|9|Animation2|http://www.roblox.com/asset/?id=180435792|jump|JumpAnim|http:/'
  2701. ..'/www.roblox.com/asset/?id=125750702|run|RunAnim|http://www.roblox.com/asset/?id=252557606|sit|SitAnim|http://www.roblox.com/asset/?id=178130996|toolnone|ToolNoneAnim|walk|WalkAnim|http://www.roblox.co'
  2702. ..'m/asset/?id=180426354|Credits (ReadMe)|Respawn|Stun|GetStuns|Wander|RakeTheme (ReadMe)|FlashEffect|1,0,1,0|1,1,1|Main|ScreenShake|Theme|rbxassetid://2593956530|rbxassetid://380102473|GetNear|1.2|rbxas'
  2703. ..'setid://468911141|NightTheme|rbxassetid://1501996092|MainScript;0,1>2>2,41>43>23,41>44>88,42>43>23,42>44>62,43>43>23,43>44>57,44>43>23,44>44>46,45>43>23,45>44>2,82>43>81,82>44>23;2|1:2;n;1|1:3|3:4|4:5'
  2704. ..'|5:6|6:7|7:4|8:8|9:9|10:10|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;4|17:13;5|1:14|18:15|18:15|19:16|20:17;6|21:18|22:19|23:20;7|1:3|5:6|6:7|8:21|9:22|10:23|24:13|5:6|5:6;n;8|1:24|7:25|25:'
  2705. ..'26;8|1:27|7:25|25:26|26:28;8|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;8|1:35|7:25|25:26|26:36;p;5|1:37|18:38|18:38|19:39|20:13;5|1:40|18:41|27:4|18:41|19:42|20:43;n;9;p;5|'
  2706. ..'1:44|19:45|20:46;5|1:47|19:48|20:49;n;3|1:50;p;5|1:51|18:52|27:4|18:52|19:42|20:43;5|1:53|19:45|20:46;5|1:54|19:45|20:46;p;1|1:55|3:4|4:5|5:6|6:7|8:56|9:9|10:57|11:11|12:11|13:11|14:11|15:11|16:11|5:6'
  2707. ..'|5:6;n;3|1:12;1|1:58|5:6|6:7|7:4|8:59|9:60|10:61|24:13|12:32|16:32|5:6|5:6;n;3|1:62;p;7|1:63|5:6|6:7|8:64|9:9|10:65|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8|'
  2708. ..'1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;p;10|1:66|7:67|10:68|25:69|28:13|29:4|30:70|31:71|32:20|33:72|34:73|35:74|36:75;10|1:76|5:77|7:67|10:78|25:69|28:13|29:4|5:77|30:7'
  2709. ..'0|5:77|31:71|32:20|33:79|34:80|35:74|36:75;3|1:76;5|1:81|18:82|18:82|19:83|20:84;5|1:85|18:86|18:86|19:87|20:88;6|21:89|22:90|37:91|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;11|1:94|40:95|41:96|42:97;11'
  2710. ..'|1:98|40:95|41:99|42:100;11|1:101|40:95|41:102|42:103;11|1:104|40:95|41:105|42:106;11|1:107|40:95|41:108|42:109;p;1|1:110|3:4|4:5|5:6|6:7|8:111|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n'
  2711. ..';6|45:113|21:114|22:115|23:20;7|1:110|5:6|6:7|8:116|9:9|10:117|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|'
  2712. ..'7:25|25:26|26:34;p;3|1:12;12|25:91;p;1|1:118|3:4|4:5|5:6|6:7|8:119|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|21:89|22:120|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;12|25:91;p;1|1'
  2713. ..':121|3:4|4:5|5:6|6:7|8:122|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|21:89|22:123|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;12|25:91;p;13;n;14|1:124|46:125;14|1:126|46:127;14|1:1'
  2714. ..'28|46:46;15|1:129|46:88;16|1:130|46:4;n;3|1:131;p;14|1:132|46:73;16|1:133;n;3|1:134;p;15|1:135|46:136;14|1:137|46:136;15|1:138|46:139;n;3|1:140;p;p;1|1:141|3:4|4:5|5:6|6:7|7:4|8:56|9:9|10:57|11:11|12:'
  2715. ..'11|13:11|14:11|15:11|16:11|5:6|5:6;n;11|1:142|40:95|41:143|42:143;p;17|1:81|47:144;18|1:55|22:145|48:34;18|1:146|22:147|48:36;18|1:148|22:149|48:20;16|1:150;1|1:151|3:4|4:5|5:6|6:7|7:4|8:152|9:9|10:11'
  2716. ..'2|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|45:113|21:114|22:153|23:20;7|1:151|5:6|6:7|8:154|9:9|10:155|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8'
  2717. ..'|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;p;12|25:91;p;3|1:156;19|1:157|49:28|50:13|51:13|52:34|53:158|54:158|55:38|56:159|57:13;n;p;3|1:160;n;20|1:161;n;17|1:162|47:163;p'
  2718. ..';20|1:164;n;17|1:165|47:166;p;20|1:167;n;17|1:168|47:169;n;15|1:170|46:171;p;17|1:172|47:173;n;15|1:170|46:4;p;p;20|1:174;n;17|1:175|47:176;p;20|1:177;n;17|1:178|47:179;p;20|1:180;n;17|1:181|47:182;p;'
  2719. ..'20|1:183;n;17|1:184|47:39;p;20|1:185;n;17|1:186|47:187;p;p;3|1:188;3|1:189;3|1:190;n;14|1:191;p;3|1:192;21|1:193;n;22|1:51|58:34;n;23|1:194|10:195|59:196|60:4|61:13;21|1:197;21|1:198;5|1:199|27:4|19:2'
  2720. ..'00|20:88;5|1:37|18:38|18:38|19:201|20:136;5|1:202|18:41|27:4|18:41|62:203|19:204|20:13;5|1:205|27:4|19:206|20:25;p;p;3|1:207;p;')
  2721. for _,Object in pairs(Objects) do
  2722. Object.Parent = script and script.Parent==workspace and script or workspace
  2723. end
  2724. for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement