Advertisement
lafur

Untitled

May 23rd, 2020
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 87.11 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 10525
  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() -- Created by Quenty (@Quenty, follow me on twitter).
  247. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  248. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  249.  
  250. --[[ INSTRUCTIONS
  251. - Place in the model
  252. - Make sure model is anchored
  253. - That's it. It will weld the model and all children.
  254.  
  255. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  256. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  257. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  258. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  259. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  260. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  261. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  262. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  263.  
  264. 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.
  265. ]]
  266.  
  267. --[[ DOCUMENTATION
  268. - 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.
  269. - Will work in PBS servers
  270. - Will work as long as it starts out with the part anchored
  271. - Stores the relative CFrame as a CFrame value
  272. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  273. - Utilizes a recursive algorith to find all parts in the model
  274. - Will reweld on script reparent if the script is initially parented to a tool.
  275. - Welds as fast as possible
  276. ]]
  277.  
  278. -- qPerfectionWeld.lua
  279. -- Created 10/6/2014
  280. -- Author: Quenty
  281. -- Version 1.0.3
  282.  
  283. -- Updated 10/14/2014 - Updated to 1.0.1
  284. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  285.  
  286. -- Updated 10/14/2014 - Updated to 1.0.2
  287. --- Fixed bug fix.
  288.  
  289. -- Updated 10/14/2014 - Updated to 1.0.3
  290. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  291.  
  292. 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).
  293.  
  294.  
  295. local function CallOnChildren(Instance, FunctionToCall)
  296. -- Calls a function on each of the children of a certain object, using recursion.
  297.  
  298. FunctionToCall(Instance)
  299.  
  300. for _, Child in next, Instance:GetChildren() do
  301. CallOnChildren(Child, FunctionToCall)
  302. end
  303. end
  304.  
  305. local function GetNearestParent(Instance, ClassName)
  306. -- Returns the nearest parent of a certain class, or returns nil
  307.  
  308. local Ancestor = Instance
  309. repeat
  310. Ancestor = Ancestor.Parent
  311. if Ancestor == nil then
  312. return nil
  313. end
  314. until Ancestor:IsA(ClassName)
  315.  
  316. return Ancestor
  317. end
  318.  
  319. local function GetBricks(StartInstance)
  320. local List = {}
  321.  
  322. -- if StartInstance:IsA("BasePart") then
  323. -- List[#List+1] = StartInstance
  324. -- end
  325.  
  326. CallOnChildren(StartInstance, function(Item)
  327. if Item:IsA("BasePart") then
  328. List[#List+1] = Item;
  329. end
  330. end)
  331.  
  332. return List
  333. end
  334.  
  335. local function Modify(Instance, Values)
  336. -- Modifies an Instance by using a table.
  337.  
  338. assert(type(Values) == "table", "Values is not a table");
  339.  
  340. for Index, Value in next, Values do
  341. if type(Index) == "number" then
  342. Value.Parent = Instance
  343. else
  344. Instance[Index] = Value
  345. end
  346. end
  347. return Instance
  348. end
  349.  
  350. local function Make(ClassType, Properties)
  351. -- Using a syntax hack to create a nice way to Make new items.
  352.  
  353. return Modify(Instance.new(ClassType), Properties)
  354. end
  355.  
  356. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  357. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  358.  
  359. local function HasWheelJoint(Part)
  360. for _, SurfaceName in pairs(Surfaces) do
  361. for _, HingSurfaceName in pairs(HingSurfaces) do
  362. if Part[SurfaceName].Name == HingSurfaceName then
  363. return true
  364. end
  365. end
  366. end
  367.  
  368. return false
  369. end
  370.  
  371. local function ShouldBreakJoints(Part)
  372. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  373. -- definitely some edge cases.
  374.  
  375. if NEVER_BREAK_JOINTS then
  376. return false
  377. end
  378.  
  379. if HasWheelJoint(Part) then
  380. return false
  381. end
  382.  
  383. local Connected = Part:GetConnectedParts()
  384.  
  385. if #Connected == 1 then
  386. return false
  387. end
  388.  
  389. for _, Item in pairs(Connected) do
  390. if HasWheelJoint(Item) then
  391. return false
  392. elseif not Item:IsDescendantOf(script.Parent) then
  393. return false
  394. end
  395. end
  396.  
  397. return true
  398. end
  399.  
  400. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  401. --- Weld's 2 parts together
  402. -- @param Part0 The first part
  403. -- @param Part1 The second part (Dependent part most of the time).
  404. -- @param [JointType] The type of joint. Defaults to weld.
  405. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  406. -- @return The weld created.
  407.  
  408. JointType = JointType or "Weld"
  409. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  410.  
  411. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  412. Modify(NewWeld, {
  413. Name = "qCFrameWeldThingy";
  414. Part0 = Part0;
  415. Part1 = Part1;
  416. C0 = CFrame.new();--Part0.CFrame:inverse();
  417. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  418. Parent = Part1;
  419. })
  420.  
  421. if not RelativeValue then
  422. RelativeValue = Make("CFrameValue", {
  423. Parent = Part1;
  424. Name = "qRelativeCFrameWeldValue";
  425. Archivable = true;
  426. Value = NewWeld.C1;
  427. })
  428. end
  429.  
  430. return NewWeld
  431. end
  432.  
  433. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  434. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  435. -- @param MainPart The part to weld the model to (can be in the model).
  436. -- @param [JointType] The type of joint. Defaults to weld.
  437. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  438.  
  439. for _, Part in pairs(Parts) do
  440. if ShouldBreakJoints(Part) then
  441. Part:BreakJoints()
  442. end
  443. end
  444.  
  445. for _, Part in pairs(Parts) do
  446. if Part ~= MainPart then
  447. WeldTogether(MainPart, Part, JointType, MainPart)
  448. end
  449. end
  450.  
  451. if not DoNotUnanchor then
  452. for _, Part in pairs(Parts) do
  453. Part.Anchored = false
  454. end
  455. MainPart.Anchored = false
  456. end
  457. end
  458.  
  459. local function PerfectionWeld()
  460. local Tool = GetNearestParent(script, "Tool")
  461.  
  462. local Parts = GetBricks(script.Parent)
  463. 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]
  464.  
  465. if PrimaryPart then
  466. WeldParts(Parts, PrimaryPart, "Weld", false)
  467. else
  468. warn("qWeld - Unable to weld part")
  469. end
  470.  
  471. return Tool
  472. end
  473.  
  474. local Tool = PerfectionWeld()
  475.  
  476.  
  477. if Tool and script.ClassName == "Script" then
  478. --- Don't bother with local scripts
  479.  
  480. script.Parent.AncestryChanged:connect(function()
  481. PerfectionWeld()
  482. end)
  483. end
  484.  
  485. -- Created by Quenty (@Quenty, follow me on twitter).
  486. end;
  487. function() -- Created by Quenty (@Quenty, follow me on twitter).
  488. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  489. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  490.  
  491. --[[ INSTRUCTIONS
  492. - Place in the model
  493. - Make sure model is anchored
  494. - That's it. It will weld the model and all children.
  495.  
  496. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  497. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  498. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  499. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  500. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  501. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  502. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  503. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  504.  
  505. 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.
  506. ]]
  507.  
  508. --[[ DOCUMENTATION
  509. - 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.
  510. - Will work in PBS servers
  511. - Will work as long as it starts out with the part anchored
  512. - Stores the relative CFrame as a CFrame value
  513. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  514. - Utilizes a recursive algorith to find all parts in the model
  515. - Will reweld on script reparent if the script is initially parented to a tool.
  516. - Welds as fast as possible
  517. ]]
  518.  
  519. -- qPerfectionWeld.lua
  520. -- Created 10/6/2014
  521. -- Author: Quenty
  522. -- Version 1.0.3
  523.  
  524. -- Updated 10/14/2014 - Updated to 1.0.1
  525. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  526.  
  527. -- Updated 10/14/2014 - Updated to 1.0.2
  528. --- Fixed bug fix.
  529.  
  530. -- Updated 10/14/2014 - Updated to 1.0.3
  531. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  532.  
  533. 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).
  534.  
  535.  
  536. local function CallOnChildren(Instance, FunctionToCall)
  537. -- Calls a function on each of the children of a certain object, using recursion.
  538.  
  539. FunctionToCall(Instance)
  540.  
  541. for _, Child in next, Instance:GetChildren() do
  542. CallOnChildren(Child, FunctionToCall)
  543. end
  544. end
  545.  
  546. local function GetNearestParent(Instance, ClassName)
  547. -- Returns the nearest parent of a certain class, or returns nil
  548.  
  549. local Ancestor = Instance
  550. repeat
  551. Ancestor = Ancestor.Parent
  552. if Ancestor == nil then
  553. return nil
  554. end
  555. until Ancestor:IsA(ClassName)
  556.  
  557. return Ancestor
  558. end
  559.  
  560. local function GetBricks(StartInstance)
  561. local List = {}
  562.  
  563. -- if StartInstance:IsA("BasePart") then
  564. -- List[#List+1] = StartInstance
  565. -- end
  566.  
  567. CallOnChildren(StartInstance, function(Item)
  568. if Item:IsA("BasePart") then
  569. List[#List+1] = Item;
  570. end
  571. end)
  572.  
  573. return List
  574. end
  575.  
  576. local function Modify(Instance, Values)
  577. -- Modifies an Instance by using a table.
  578.  
  579. assert(type(Values) == "table", "Values is not a table");
  580.  
  581. for Index, Value in next, Values do
  582. if type(Index) == "number" then
  583. Value.Parent = Instance
  584. else
  585. Instance[Index] = Value
  586. end
  587. end
  588. return Instance
  589. end
  590.  
  591. local function Make(ClassType, Properties)
  592. -- Using a syntax hack to create a nice way to Make new items.
  593.  
  594. return Modify(Instance.new(ClassType), Properties)
  595. end
  596.  
  597. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  598. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  599.  
  600. local function HasWheelJoint(Part)
  601. for _, SurfaceName in pairs(Surfaces) do
  602. for _, HingSurfaceName in pairs(HingSurfaces) do
  603. if Part[SurfaceName].Name == HingSurfaceName then
  604. return true
  605. end
  606. end
  607. end
  608.  
  609. return false
  610. end
  611.  
  612. local function ShouldBreakJoints(Part)
  613. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  614. -- definitely some edge cases.
  615.  
  616. if NEVER_BREAK_JOINTS then
  617. return false
  618. end
  619.  
  620. if HasWheelJoint(Part) then
  621. return false
  622. end
  623.  
  624. local Connected = Part:GetConnectedParts()
  625.  
  626. if #Connected == 1 then
  627. return false
  628. end
  629.  
  630. for _, Item in pairs(Connected) do
  631. if HasWheelJoint(Item) then
  632. return false
  633. elseif not Item:IsDescendantOf(script.Parent) then
  634. return false
  635. end
  636. end
  637.  
  638. return true
  639. end
  640.  
  641. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  642. --- Weld's 2 parts together
  643. -- @param Part0 The first part
  644. -- @param Part1 The second part (Dependent part most of the time).
  645. -- @param [JointType] The type of joint. Defaults to weld.
  646. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  647. -- @return The weld created.
  648.  
  649. JointType = JointType or "Weld"
  650. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  651.  
  652. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  653. Modify(NewWeld, {
  654. Name = "qCFrameWeldThingy";
  655. Part0 = Part0;
  656. Part1 = Part1;
  657. C0 = CFrame.new();--Part0.CFrame:inverse();
  658. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  659. Parent = Part1;
  660. })
  661.  
  662. if not RelativeValue then
  663. RelativeValue = Make("CFrameValue", {
  664. Parent = Part1;
  665. Name = "qRelativeCFrameWeldValue";
  666. Archivable = true;
  667. Value = NewWeld.C1;
  668. })
  669. end
  670.  
  671. return NewWeld
  672. end
  673.  
  674. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  675. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  676. -- @param MainPart The part to weld the model to (can be in the model).
  677. -- @param [JointType] The type of joint. Defaults to weld.
  678. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  679.  
  680. for _, Part in pairs(Parts) do
  681. if ShouldBreakJoints(Part) then
  682. Part:BreakJoints()
  683. end
  684. end
  685.  
  686. for _, Part in pairs(Parts) do
  687. if Part ~= MainPart then
  688. WeldTogether(MainPart, Part, JointType, MainPart)
  689. end
  690. end
  691.  
  692. if not DoNotUnanchor then
  693. for _, Part in pairs(Parts) do
  694. Part.Anchored = false
  695. end
  696. MainPart.Anchored = false
  697. end
  698. end
  699.  
  700. local function PerfectionWeld()
  701. local Tool = GetNearestParent(script, "Tool")
  702.  
  703. local Parts = GetBricks(script.Parent)
  704. 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]
  705.  
  706. if PrimaryPart then
  707. WeldParts(Parts, PrimaryPart, "Weld", false)
  708. else
  709. warn("qWeld - Unable to weld part")
  710. end
  711.  
  712. return Tool
  713. end
  714.  
  715. local Tool = PerfectionWeld()
  716.  
  717.  
  718. if Tool and script.ClassName == "Script" then
  719. --- Don't bother with local scripts
  720.  
  721. script.Parent.AncestryChanged:connect(function()
  722. PerfectionWeld()
  723. end)
  724. end
  725.  
  726. -- Created by Quenty (@Quenty, follow me on twitter).
  727. end;
  728. function() -- Created by Quenty (@Quenty, follow me on twitter).
  729. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  730. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  731.  
  732. --[[ INSTRUCTIONS
  733. - Place in the model
  734. - Make sure model is anchored
  735. - That's it. It will weld the model and all children.
  736.  
  737. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  738. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  739. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  740. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  741. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  742. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  743. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  744. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  745.  
  746. 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.
  747. ]]
  748.  
  749. --[[ DOCUMENTATION
  750. - 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.
  751. - Will work in PBS servers
  752. - Will work as long as it starts out with the part anchored
  753. - Stores the relative CFrame as a CFrame value
  754. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  755. - Utilizes a recursive algorith to find all parts in the model
  756. - Will reweld on script reparent if the script is initially parented to a tool.
  757. - Welds as fast as possible
  758. ]]
  759.  
  760. -- qPerfectionWeld.lua
  761. -- Created 10/6/2014
  762. -- Author: Quenty
  763. -- Version 1.0.3
  764.  
  765. -- Updated 10/14/2014 - Updated to 1.0.1
  766. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  767.  
  768. -- Updated 10/14/2014 - Updated to 1.0.2
  769. --- Fixed bug fix.
  770.  
  771. -- Updated 10/14/2014 - Updated to 1.0.3
  772. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  773.  
  774. 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).
  775.  
  776.  
  777. local function CallOnChildren(Instance, FunctionToCall)
  778. -- Calls a function on each of the children of a certain object, using recursion.
  779.  
  780. FunctionToCall(Instance)
  781.  
  782. for _, Child in next, Instance:GetChildren() do
  783. CallOnChildren(Child, FunctionToCall)
  784. end
  785. end
  786.  
  787. local function GetNearestParent(Instance, ClassName)
  788. -- Returns the nearest parent of a certain class, or returns nil
  789.  
  790. local Ancestor = Instance
  791. repeat
  792. Ancestor = Ancestor.Parent
  793. if Ancestor == nil then
  794. return nil
  795. end
  796. until Ancestor:IsA(ClassName)
  797.  
  798. return Ancestor
  799. end
  800.  
  801. local function GetBricks(StartInstance)
  802. local List = {}
  803.  
  804. -- if StartInstance:IsA("BasePart") then
  805. -- List[#List+1] = StartInstance
  806. -- end
  807.  
  808. CallOnChildren(StartInstance, function(Item)
  809. if Item:IsA("BasePart") then
  810. List[#List+1] = Item;
  811. end
  812. end)
  813.  
  814. return List
  815. end
  816.  
  817. local function Modify(Instance, Values)
  818. -- Modifies an Instance by using a table.
  819.  
  820. assert(type(Values) == "table", "Values is not a table");
  821.  
  822. for Index, Value in next, Values do
  823. if type(Index) == "number" then
  824. Value.Parent = Instance
  825. else
  826. Instance[Index] = Value
  827. end
  828. end
  829. return Instance
  830. end
  831.  
  832. local function Make(ClassType, Properties)
  833. -- Using a syntax hack to create a nice way to Make new items.
  834.  
  835. return Modify(Instance.new(ClassType), Properties)
  836. end
  837.  
  838. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  839. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  840.  
  841. local function HasWheelJoint(Part)
  842. for _, SurfaceName in pairs(Surfaces) do
  843. for _, HingSurfaceName in pairs(HingSurfaces) do
  844. if Part[SurfaceName].Name == HingSurfaceName then
  845. return true
  846. end
  847. end
  848. end
  849.  
  850. return false
  851. end
  852.  
  853. local function ShouldBreakJoints(Part)
  854. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  855. -- definitely some edge cases.
  856.  
  857. if NEVER_BREAK_JOINTS then
  858. return false
  859. end
  860.  
  861. if HasWheelJoint(Part) then
  862. return false
  863. end
  864.  
  865. local Connected = Part:GetConnectedParts()
  866.  
  867. if #Connected == 1 then
  868. return false
  869. end
  870.  
  871. for _, Item in pairs(Connected) do
  872. if HasWheelJoint(Item) then
  873. return false
  874. elseif not Item:IsDescendantOf(script.Parent) then
  875. return false
  876. end
  877. end
  878.  
  879. return true
  880. end
  881.  
  882. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  883. --- Weld's 2 parts together
  884. -- @param Part0 The first part
  885. -- @param Part1 The second part (Dependent part most of the time).
  886. -- @param [JointType] The type of joint. Defaults to weld.
  887. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  888. -- @return The weld created.
  889.  
  890. JointType = JointType or "Weld"
  891. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  892.  
  893. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  894. Modify(NewWeld, {
  895. Name = "qCFrameWeldThingy";
  896. Part0 = Part0;
  897. Part1 = Part1;
  898. C0 = CFrame.new();--Part0.CFrame:inverse();
  899. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  900. Parent = Part1;
  901. })
  902.  
  903. if not RelativeValue then
  904. RelativeValue = Make("CFrameValue", {
  905. Parent = Part1;
  906. Name = "qRelativeCFrameWeldValue";
  907. Archivable = true;
  908. Value = NewWeld.C1;
  909. })
  910. end
  911.  
  912. return NewWeld
  913. end
  914.  
  915. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  916. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  917. -- @param MainPart The part to weld the model to (can be in the model).
  918. -- @param [JointType] The type of joint. Defaults to weld.
  919. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  920.  
  921. for _, Part in pairs(Parts) do
  922. if ShouldBreakJoints(Part) then
  923. Part:BreakJoints()
  924. end
  925. end
  926.  
  927. for _, Part in pairs(Parts) do
  928. if Part ~= MainPart then
  929. WeldTogether(MainPart, Part, JointType, MainPart)
  930. end
  931. end
  932.  
  933. if not DoNotUnanchor then
  934. for _, Part in pairs(Parts) do
  935. Part.Anchored = false
  936. end
  937. MainPart.Anchored = false
  938. end
  939. end
  940.  
  941. local function PerfectionWeld()
  942. local Tool = GetNearestParent(script, "Tool")
  943.  
  944. local Parts = GetBricks(script.Parent)
  945. 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]
  946.  
  947. if PrimaryPart then
  948. WeldParts(Parts, PrimaryPart, "Weld", false)
  949. else
  950. warn("qWeld - Unable to weld part")
  951. end
  952.  
  953. return Tool
  954. end
  955.  
  956. local Tool = PerfectionWeld()
  957.  
  958.  
  959. if Tool and script.ClassName == "Script" then
  960. --- Don't bother with local scripts
  961.  
  962. script.Parent.AncestryChanged:connect(function()
  963. PerfectionWeld()
  964. end)
  965. end
  966.  
  967. -- Created by Quenty (@Quenty, follow me on twitter).
  968. end;
  969. function() --Responsible for regening a player's humanoid's health
  970.  
  971. -- declarations
  972. local Figure = script.Parent
  973. local Head = Figure:WaitForChild("Head")
  974. local Humanoid;
  975. for _,Child in pairs(Figure:GetChildren())do
  976. if Child and Child.ClassName=="Humanoid"then
  977. Humanoid=Child;
  978. end;
  979. end;
  980. local regening = false
  981.  
  982. -- regeneration
  983. function regenHealth()
  984. if regening then return end
  985. regening = true
  986.  
  987. while Humanoid.Health < Humanoid.MaxHealth do
  988. local s = wait(1)
  989. local health = Humanoid.Health
  990. if health~=0 and health < Humanoid.MaxHealth then
  991. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  992. health = health + newHealthDelta
  993. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  994. end
  995. end
  996.  
  997. if Humanoid.Health > Humanoid.MaxHealth then
  998. Humanoid.Health = Humanoid.MaxHealth
  999. end
  1000.  
  1001. regening = false
  1002. end
  1003.  
  1004. Humanoid.HealthChanged:connect(regenHealth)
  1005. end;
  1006. function() --[[ By: Brutez. ]]--
  1007. local JeffTheKillerScript=script;
  1008. repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
  1009. local JeffTheKiller=JeffTheKillerScript.Parent;
  1010. function raycast(Spos,vec,currentdist)
  1011. local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
  1012. if hit2~=nil and pos2 then
  1013. if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
  1014. local currentdist=currentdist-(pos2-Spos).magnitude;
  1015. return raycast(pos2,vec,currentdist);
  1016. end;
  1017. end;
  1018. return hit2,pos2;
  1019. end;
  1020. function RayCast(Position,Direction,MaxDistance,IgnoreList)
  1021. return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
  1022. end;
  1023. --[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
  1024. --[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
  1025. --[[end;]]--
  1026. local JeffTheKillerHumanoid;
  1027. for _,Child in pairs(JeffTheKiller:GetChildren())do
  1028. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  1029. JeffTheKillerHumanoid=Child;
  1030. end;
  1031. end;
  1032. local AttackDebounce=false;
  1033. local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
  1034. local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
  1035. local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
  1036. local WalkDebounce=false;
  1037. local Notice=false;
  1038. local JeffLaughDebounce=false;
  1039. local MusicDebounce=false;
  1040. local NoticeDebounce=false;
  1041. local ChosenMusic;
  1042. function FindNearestBae()
  1043. local NoticeDistance=80;
  1044. local TargetMain;
  1045. for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
  1046. 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("Torso")and TargetModel:FindFirstChild("Head")then
  1047. local TargetPart=TargetModel:FindFirstChild("Torso");
  1048. local FoundHumanoid;
  1049. for _,Child in pairs(TargetModel:GetChildren())do
  1050. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  1051. FoundHumanoid=Child;
  1052. end;
  1053. end;
  1054. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
  1055. TargetMain=TargetPart;
  1056. NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
  1057. local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
  1058. if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
  1059. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
  1060. Spawn(function()
  1061. AttackDebounce=true;
  1062. local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
  1063. local SwingChoice=math.random(1,2);
  1064. local HitChoice=math.random(1,3);
  1065. SwingAnimation:Play();
  1066. SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
  1067. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
  1068. local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
  1069. SwingSound.Pitch=1+(math.random()*0.04);
  1070. SwingSound:Play();
  1071. end;
  1072. Wait(0.3);
  1073. if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
  1074. FoundHumanoid:TakeDamage(300);
  1075. if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
  1076. local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
  1077. HitSound.Pitch=1+(math.random()*0.04);
  1078. HitSound:Play();
  1079. elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
  1080. local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
  1081. HitSound.Pitch=1+(math.random()*0.04);
  1082. HitSound:Play();
  1083. elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
  1084. local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
  1085. HitSound.Pitch=1+(math.random()*0.04);
  1086. HitSound:Play();
  1087. end;
  1088. end;
  1089. Wait(0.1);
  1090. AttackDebounce=false;
  1091. end);
  1092. end;
  1093. end;
  1094. end;
  1095. end;
  1096. end;
  1097. return TargetMain;
  1098. end;
  1099. while Wait(0)do
  1100. local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
  1101. 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})
  1102. local Jumpable=false;
  1103. if Blockage then
  1104. Jumpable=true;
  1105. if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
  1106. local BlockageHumanoid;
  1107. for _,Child in pairs(Blockage.Parent:GetChildren())do
  1108. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  1109. BlockageHumanoid=Child;
  1110. end;
  1111. end;
  1112. if Blockage and Blockage:IsA("Terrain")then
  1113. local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
  1114. local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
  1115. if CellMaterial==Enum.CellMaterial.Water then
  1116. Jumpable=false;
  1117. end;
  1118. 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"then
  1119. Jumpable=false;
  1120. end;
  1121. end;
  1122. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
  1123. JeffTheKillerHumanoid.Jump=true;
  1124. end;
  1125. end;
  1126. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  1127. Spawn(function()
  1128. WalkDebounce=true;
  1129. local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
  1130. local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
  1131. if RayTarget then
  1132. local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
  1133. JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
  1134. JeffTheKillerHeadFootStepClone:Play();
  1135. JeffTheKillerHeadFootStepClone:Destroy();
  1136. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
  1137. Wait(0.5);
  1138. elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
  1139. Wait(0.2);
  1140. end
  1141. end;
  1142. WalkDebounce=false;
  1143. end);
  1144. end;
  1145. local MainTarget=FindNearestBae();
  1146. local FoundHumanoid;
  1147. if MainTarget then
  1148. for _,Child in pairs(MainTarget.Parent:GetChildren())do
  1149. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  1150. FoundHumanoid=Child;
  1151. end;
  1152. end;
  1153. end;
  1154. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
  1155. JeffTheKillerHumanoid.Jump=true;
  1156. end;
  1157. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
  1158. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
  1159. JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
  1160. JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
  1161. end;
  1162. elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
  1163. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
  1164. if not JeffLaughDebounce then
  1165. Spawn(function()
  1166. JeffLaughDebounce=true;
  1167. repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
  1168. JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
  1169. JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
  1170. JeffLaughDebounce=false;
  1171. end);
  1172. end;
  1173. end;
  1174. end;
  1175. 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
  1176. local MusicChoice=math.random(1,2);
  1177. if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
  1178. ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
  1179. elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
  1180. ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
  1181. end;
  1182. if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
  1183. ChosenMusic.Volume=0.5;
  1184. ChosenMusic:Play();
  1185. end;
  1186. 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
  1187. if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
  1188. if not MusicDebounce then
  1189. Spawn(function()
  1190. MusicDebounce=true;
  1191. repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
  1192. if ChosenMusic then
  1193. ChosenMusic.Volume=0;
  1194. ChosenMusic:Stop();
  1195. end;
  1196. ChosenMusic=nil;
  1197. MusicDebounce=false;
  1198. end);
  1199. end;
  1200. end;
  1201. end;
  1202. if not MainTarget and not JeffLaughDebounce then
  1203. Spawn(function()
  1204. JeffLaughDebounce=true;
  1205. repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
  1206. JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
  1207. JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
  1208. JeffLaughDebounce=false;
  1209. end);
  1210. end;
  1211. if not MainTarget and not MusicDebounce then
  1212. Spawn(function()
  1213. MusicDebounce=true;
  1214. repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
  1215. if ChosenMusic then
  1216. ChosenMusic.Volume=0;
  1217. ChosenMusic:Stop();
  1218. end;
  1219. ChosenMusic=nil;
  1220. MusicDebounce=false;
  1221. end);
  1222. end;
  1223. if MainTarget then
  1224. Notice=true;
  1225. if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
  1226. JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
  1227. NoticeDebounce=true;
  1228. end
  1229. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  1230. if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
  1231. JeffTheKillerHumanoid.WalkSpeed=18;
  1232. elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
  1233. JeffTheKillerHumanoid.WalkSpeed=0.004;
  1234. end;
  1235. JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
  1236. end;
  1237. else
  1238. Notice=false;
  1239. NoticeDebounce=false;
  1240. local RandomWalk=math.random(1,150);
  1241. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
  1242. JeffTheKillerHumanoid.WalkSpeed=12;
  1243. if RandomWalk==1 then
  1244. JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
  1245. end;
  1246. end;
  1247. end;
  1248. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
  1249. JeffTheKillerHumanoid.DisplayDistanceType="None";
  1250. JeffTheKillerHumanoid.HealthDisplayDistance=1000;
  1251. JeffTheKillerHumanoid.Name="Humanoid";
  1252. JeffTheKillerHumanoid.NameDisplayDistance=0;
  1253. JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
  1254. JeffTheKillerHumanoid.AutoJumpEnabled=true;
  1255. JeffTheKillerHumanoid.AutoRotate=true;
  1256. JeffTheKillerHumanoid.MaxHealth=100;
  1257. JeffTheKillerHumanoid.JumpPower=60;
  1258. JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
  1259. end;
  1260. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
  1261. JeffTheKillerHumanoid.AutoJumpEnabled=true;
  1262. end;
  1263. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
  1264. JeffTheKillerHumanoid.AutoRotate=true;
  1265. end;
  1266. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
  1267. JeffTheKillerHumanoid.PlatformStand=false;
  1268. end;
  1269. if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
  1270. JeffTheKillerHumanoid.Sit=false;
  1271. end;
  1272. end;
  1273. --[[ By: Brutez. ]]-- end;
  1274. function() --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
  1275. 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. ]]--
  1276. local AdvancedRespawnScript=script;
  1277. repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
  1278. local JeffTheKiller=AdvancedRespawnScript.Parent;
  1279. if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
  1280. JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
  1281. end;
  1282. local GameDerbis=Game:GetService("Debris");
  1283. local JeffTheKillerHumanoid;
  1284. for _,Child in pairs(JeffTheKiller:GetChildren())do
  1285. if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
  1286. JeffTheKillerHumanoid=Child;
  1287. end;
  1288. end;
  1289. local Respawndant=JeffTheKiller:Clone();
  1290. if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
  1291. coroutine.resume(coroutine.create(function()
  1292. if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
  1293. SpawnModel=Instance.new("Model");
  1294. SpawnModel.Parent=JeffTheKillerHumanoid.Status;
  1295. SpawnModel.Name="AvalibleSpawns";
  1296. else
  1297. SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
  1298. end;
  1299. function FindSpawn(SearchValue)
  1300. local PartsArchivable=SearchValue:GetChildren();
  1301. for AreaSearch=1,#PartsArchivable do
  1302. if PartsArchivable[AreaSearch].className=="SpawnLocation"then
  1303. local PositionValue=Instance.new("Vector3Value",SpawnModel);
  1304. PositionValue.Value=PartsArchivable[AreaSearch].Position;
  1305. PositionValue.Name=PartsArchivable[AreaSearch].Duration;
  1306. end;
  1307. FindSpawn(PartsArchivable[AreaSearch]);
  1308. end;
  1309. end;
  1310. FindSpawn(Game:GetService("Workspace"));
  1311. local SpawnChilden=SpawnModel:GetChildren();
  1312. if#SpawnChilden>0 then
  1313. local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
  1314. local RespawningForceField=Instance.new("ForceField");
  1315. RespawningForceField.Parent=JeffTheKiller;
  1316. RespawningForceField.Name="SpawnForceField";
  1317. GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
  1318. JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
  1319. else
  1320. if JeffTheKiller:FindFirstChild("SpawnForceField")then
  1321. JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
  1322. end;
  1323. JeffTheKiller:MoveTo(Vector3.new(0,115,0));
  1324. end;
  1325. end));
  1326. end;
  1327. function Respawn()
  1328. Wait(5);
  1329. Respawndant.Parent=JeffTheKiller.Parent;
  1330. Respawndant:makeJoints();
  1331. Respawndant:FindFirstChild("Head"):MakeJoints();
  1332. Respawndant:FindFirstChild("Torso"):MakeJoints();
  1333. JeffTheKiller:remove();
  1334. end;
  1335. if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
  1336. JeffTheKillerHumanoid.Died:connect(Respawn);
  1337. end;
  1338. --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]-- end;
  1339. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1340. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1341. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1342.  
  1343. --[[ INSTRUCTIONS
  1344. - Place in the model
  1345. - Make sure model is anchored
  1346. - That's it. It will weld the model and all children.
  1347.  
  1348. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1349. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1350. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1351. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1352. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1353. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1354. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1355. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1356.  
  1357. 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.
  1358. ]]
  1359.  
  1360. --[[ DOCUMENTATION
  1361. - 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.
  1362. - Will work in PBS servers
  1363. - Will work as long as it starts out with the part anchored
  1364. - Stores the relative CFrame as a CFrame value
  1365. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1366. - Utilizes a recursive algorith to find all parts in the model
  1367. - Will reweld on script reparent if the script is initially parented to a tool.
  1368. - Welds as fast as possible
  1369. ]]
  1370.  
  1371. -- qPerfectionWeld.lua
  1372. -- Created 10/6/2014
  1373. -- Author: Quenty
  1374. -- Version 1.0.3
  1375.  
  1376. -- Updated 10/14/2014 - Updated to 1.0.1
  1377. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1378.  
  1379. -- Updated 10/14/2014 - Updated to 1.0.2
  1380. --- Fixed bug fix.
  1381.  
  1382. -- Updated 10/14/2014 - Updated to 1.0.3
  1383. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1384.  
  1385. 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).
  1386.  
  1387.  
  1388. local function CallOnChildren(Instance, FunctionToCall)
  1389. -- Calls a function on each of the children of a certain object, using recursion.
  1390.  
  1391. FunctionToCall(Instance)
  1392.  
  1393. for _, Child in next, Instance:GetChildren() do
  1394. CallOnChildren(Child, FunctionToCall)
  1395. end
  1396. end
  1397.  
  1398. local function GetNearestParent(Instance, ClassName)
  1399. -- Returns the nearest parent of a certain class, or returns nil
  1400.  
  1401. local Ancestor = Instance
  1402. repeat
  1403. Ancestor = Ancestor.Parent
  1404. if Ancestor == nil then
  1405. return nil
  1406. end
  1407. until Ancestor:IsA(ClassName)
  1408.  
  1409. return Ancestor
  1410. end
  1411.  
  1412. local function GetBricks(StartInstance)
  1413. local List = {}
  1414.  
  1415. -- if StartInstance:IsA("BasePart") then
  1416. -- List[#List+1] = StartInstance
  1417. -- end
  1418.  
  1419. CallOnChildren(StartInstance, function(Item)
  1420. if Item:IsA("BasePart") then
  1421. List[#List+1] = Item;
  1422. end
  1423. end)
  1424.  
  1425. return List
  1426. end
  1427.  
  1428. local function Modify(Instance, Values)
  1429. -- Modifies an Instance by using a table.
  1430.  
  1431. assert(type(Values) == "table", "Values is not a table");
  1432.  
  1433. for Index, Value in next, Values do
  1434. if type(Index) == "number" then
  1435. Value.Parent = Instance
  1436. else
  1437. Instance[Index] = Value
  1438. end
  1439. end
  1440. return Instance
  1441. end
  1442.  
  1443. local function Make(ClassType, Properties)
  1444. -- Using a syntax hack to create a nice way to Make new items.
  1445.  
  1446. return Modify(Instance.new(ClassType), Properties)
  1447. end
  1448.  
  1449. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1450. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1451.  
  1452. local function HasWheelJoint(Part)
  1453. for _, SurfaceName in pairs(Surfaces) do
  1454. for _, HingSurfaceName in pairs(HingSurfaces) do
  1455. if Part[SurfaceName].Name == HingSurfaceName then
  1456. return true
  1457. end
  1458. end
  1459. end
  1460.  
  1461. return false
  1462. end
  1463.  
  1464. local function ShouldBreakJoints(Part)
  1465. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1466. -- definitely some edge cases.
  1467.  
  1468. if NEVER_BREAK_JOINTS then
  1469. return false
  1470. end
  1471.  
  1472. if HasWheelJoint(Part) then
  1473. return false
  1474. end
  1475.  
  1476. local Connected = Part:GetConnectedParts()
  1477.  
  1478. if #Connected == 1 then
  1479. return false
  1480. end
  1481.  
  1482. for _, Item in pairs(Connected) do
  1483. if HasWheelJoint(Item) then
  1484. return false
  1485. elseif not Item:IsDescendantOf(script.Parent) then
  1486. return false
  1487. end
  1488. end
  1489.  
  1490. return true
  1491. end
  1492.  
  1493. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1494. --- Weld's 2 parts together
  1495. -- @param Part0 The first part
  1496. -- @param Part1 The second part (Dependent part most of the time).
  1497. -- @param [JointType] The type of joint. Defaults to weld.
  1498. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1499. -- @return The weld created.
  1500.  
  1501. JointType = JointType or "Weld"
  1502. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1503.  
  1504. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1505. Modify(NewWeld, {
  1506. Name = "qCFrameWeldThingy";
  1507. Part0 = Part0;
  1508. Part1 = Part1;
  1509. C0 = CFrame.new();--Part0.CFrame:inverse();
  1510. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1511. Parent = Part1;
  1512. })
  1513.  
  1514. if not RelativeValue then
  1515. RelativeValue = Make("CFrameValue", {
  1516. Parent = Part1;
  1517. Name = "qRelativeCFrameWeldValue";
  1518. Archivable = true;
  1519. Value = NewWeld.C1;
  1520. })
  1521. end
  1522.  
  1523. return NewWeld
  1524. end
  1525.  
  1526. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1527. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1528. -- @param MainPart The part to weld the model to (can be in the model).
  1529. -- @param [JointType] The type of joint. Defaults to weld.
  1530. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1531.  
  1532. for _, Part in pairs(Parts) do
  1533. if ShouldBreakJoints(Part) then
  1534. Part:BreakJoints()
  1535. end
  1536. end
  1537.  
  1538. for _, Part in pairs(Parts) do
  1539. if Part ~= MainPart then
  1540. WeldTogether(MainPart, Part, JointType, MainPart)
  1541. end
  1542. end
  1543.  
  1544. if not DoNotUnanchor then
  1545. for _, Part in pairs(Parts) do
  1546. Part.Anchored = false
  1547. end
  1548. MainPart.Anchored = false
  1549. end
  1550. end
  1551.  
  1552. local function PerfectionWeld()
  1553. local Tool = GetNearestParent(script, "Tool")
  1554.  
  1555. local Parts = GetBricks(script.Parent)
  1556. 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]
  1557.  
  1558. if PrimaryPart then
  1559. WeldParts(Parts, PrimaryPart, "Weld", false)
  1560. else
  1561. warn("qWeld - Unable to weld part")
  1562. end
  1563.  
  1564. return Tool
  1565. end
  1566.  
  1567. local Tool = PerfectionWeld()
  1568.  
  1569.  
  1570. if Tool and script.ClassName == "Script" then
  1571. --- Don't bother with local scripts
  1572.  
  1573. script.Parent.AncestryChanged:connect(function()
  1574. PerfectionWeld()
  1575. end)
  1576. end
  1577.  
  1578. -- Created by Quenty (@Quenty, follow me on twitter).
  1579. end;
  1580. function() function onTouched(hit)
  1581. local human = hit.Parent:findFirstChild("Humanoid")
  1582. if (human ~= nil) then
  1583. human.Health = human.Health - 5 -- Change the amount to change the damage.
  1584. end
  1585. end
  1586. script.Parent.Touched:connect(onTouched) end;
  1587. function() -- Created by Quenty (@Quenty, follow me on twitter).
  1588. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1589. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1590.  
  1591. --[[ INSTRUCTIONS
  1592. - Place in the model
  1593. - Make sure model is anchored
  1594. - That's it. It will weld the model and all children.
  1595.  
  1596. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1597. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1598. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1599. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1600. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1601. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1602. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1603. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1604.  
  1605. 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.
  1606. ]]
  1607.  
  1608. --[[ DOCUMENTATION
  1609. - 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.
  1610. - Will work in PBS servers
  1611. - Will work as long as it starts out with the part anchored
  1612. - Stores the relative CFrame as a CFrame value
  1613. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1614. - Utilizes a recursive algorith to find all parts in the model
  1615. - Will reweld on script reparent if the script is initially parented to a tool.
  1616. - Welds as fast as possible
  1617. ]]
  1618.  
  1619. -- qPerfectionWeld.lua
  1620. -- Created 10/6/2014
  1621. -- Author: Quenty
  1622. -- Version 1.0.3
  1623.  
  1624. -- Updated 10/14/2014 - Updated to 1.0.1
  1625. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1626.  
  1627. -- Updated 10/14/2014 - Updated to 1.0.2
  1628. --- Fixed bug fix.
  1629.  
  1630. -- Updated 10/14/2014 - Updated to 1.0.3
  1631. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1632.  
  1633. 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).
  1634.  
  1635.  
  1636. local function CallOnChildren(Instance, FunctionToCall)
  1637. -- Calls a function on each of the children of a certain object, using recursion.
  1638.  
  1639. FunctionToCall(Instance)
  1640.  
  1641. for _, Child in next, Instance:GetChildren() do
  1642. CallOnChildren(Child, FunctionToCall)
  1643. end
  1644. end
  1645.  
  1646. local function GetNearestParent(Instance, ClassName)
  1647. -- Returns the nearest parent of a certain class, or returns nil
  1648.  
  1649. local Ancestor = Instance
  1650. repeat
  1651. Ancestor = Ancestor.Parent
  1652. if Ancestor == nil then
  1653. return nil
  1654. end
  1655. until Ancestor:IsA(ClassName)
  1656.  
  1657. return Ancestor
  1658. end
  1659.  
  1660. local function GetBricks(StartInstance)
  1661. local List = {}
  1662.  
  1663. -- if StartInstance:IsA("BasePart") then
  1664. -- List[#List+1] = StartInstance
  1665. -- end
  1666.  
  1667. CallOnChildren(StartInstance, function(Item)
  1668. if Item:IsA("BasePart") then
  1669. List[#List+1] = Item;
  1670. end
  1671. end)
  1672.  
  1673. return List
  1674. end
  1675.  
  1676. local function Modify(Instance, Values)
  1677. -- Modifies an Instance by using a table.
  1678.  
  1679. assert(type(Values) == "table", "Values is not a table");
  1680.  
  1681. for Index, Value in next, Values do
  1682. if type(Index) == "number" then
  1683. Value.Parent = Instance
  1684. else
  1685. Instance[Index] = Value
  1686. end
  1687. end
  1688. return Instance
  1689. end
  1690.  
  1691. local function Make(ClassType, Properties)
  1692. -- Using a syntax hack to create a nice way to Make new items.
  1693.  
  1694. return Modify(Instance.new(ClassType), Properties)
  1695. end
  1696.  
  1697. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1698. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1699.  
  1700. local function HasWheelJoint(Part)
  1701. for _, SurfaceName in pairs(Surfaces) do
  1702. for _, HingSurfaceName in pairs(HingSurfaces) do
  1703. if Part[SurfaceName].Name == HingSurfaceName then
  1704. return true
  1705. end
  1706. end
  1707. end
  1708.  
  1709. return false
  1710. end
  1711.  
  1712. local function ShouldBreakJoints(Part)
  1713. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1714. -- definitely some edge cases.
  1715.  
  1716. if NEVER_BREAK_JOINTS then
  1717. return false
  1718. end
  1719.  
  1720. if HasWheelJoint(Part) then
  1721. return false
  1722. end
  1723.  
  1724. local Connected = Part:GetConnectedParts()
  1725.  
  1726. if #Connected == 1 then
  1727. return false
  1728. end
  1729.  
  1730. for _, Item in pairs(Connected) do
  1731. if HasWheelJoint(Item) then
  1732. return false
  1733. elseif not Item:IsDescendantOf(script.Parent) then
  1734. return false
  1735. end
  1736. end
  1737.  
  1738. return true
  1739. end
  1740.  
  1741. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1742. --- Weld's 2 parts together
  1743. -- @param Part0 The first part
  1744. -- @param Part1 The second part (Dependent part most of the time).
  1745. -- @param [JointType] The type of joint. Defaults to weld.
  1746. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1747. -- @return The weld created.
  1748.  
  1749. JointType = JointType or "Weld"
  1750. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1751.  
  1752. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1753. Modify(NewWeld, {
  1754. Name = "qCFrameWeldThingy";
  1755. Part0 = Part0;
  1756. Part1 = Part1;
  1757. C0 = CFrame.new();--Part0.CFrame:inverse();
  1758. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1759. Parent = Part1;
  1760. })
  1761.  
  1762. if not RelativeValue then
  1763. RelativeValue = Make("CFrameValue", {
  1764. Parent = Part1;
  1765. Name = "qRelativeCFrameWeldValue";
  1766. Archivable = true;
  1767. Value = NewWeld.C1;
  1768. })
  1769. end
  1770.  
  1771. return NewWeld
  1772. end
  1773.  
  1774. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1775. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1776. -- @param MainPart The part to weld the model to (can be in the model).
  1777. -- @param [JointType] The type of joint. Defaults to weld.
  1778. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1779.  
  1780. for _, Part in pairs(Parts) do
  1781. if ShouldBreakJoints(Part) then
  1782. Part:BreakJoints()
  1783. end
  1784. end
  1785.  
  1786. for _, Part in pairs(Parts) do
  1787. if Part ~= MainPart then
  1788. WeldTogether(MainPart, Part, JointType, MainPart)
  1789. end
  1790. end
  1791.  
  1792. if not DoNotUnanchor then
  1793. for _, Part in pairs(Parts) do
  1794. Part.Anchored = false
  1795. end
  1796. MainPart.Anchored = false
  1797. end
  1798. end
  1799.  
  1800. local function PerfectionWeld()
  1801. local Tool = GetNearestParent(script, "Tool")
  1802.  
  1803. local Parts = GetBricks(script.Parent)
  1804. 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]
  1805.  
  1806. if PrimaryPart then
  1807. WeldParts(Parts, PrimaryPart, "Weld", false)
  1808. else
  1809. warn("qWeld - Unable to weld part")
  1810. end
  1811.  
  1812. return Tool
  1813. end
  1814.  
  1815. local Tool = PerfectionWeld()
  1816.  
  1817.  
  1818. if Tool and script.ClassName == "Script" then
  1819. --- Don't bother with local scripts
  1820.  
  1821. script.Parent.AncestryChanged:connect(function()
  1822. PerfectionWeld()
  1823. end)
  1824. end
  1825.  
  1826. -- Created by Quenty (@Quenty, follow me on twitter).
  1827. end;
  1828. function() function waitForChild(parent, childName)
  1829. local child = parent:findFirstChild(childName)
  1830. if child then return child end
  1831. while true do
  1832. child = parent.ChildAdded:wait()
  1833. if child.Name==childName then return child end
  1834. end
  1835. end
  1836.  
  1837. local Figure = script.Parent
  1838. local Torso = waitForChild(Figure, "Torso")
  1839. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  1840. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  1841. local RightHip = waitForChild(Torso, "Right Hip")
  1842. local LeftHip = waitForChild(Torso, "Left Hip")
  1843. local Neck = waitForChild(Torso, "Neck")
  1844. local Humanoid = waitForChild(Figure, "Humanoid")
  1845. local pose = "Standing"
  1846.  
  1847. local currentAnim = ""
  1848. local currentAnimTrack = nil
  1849. local currentAnimKeyframeHandler = nil
  1850. local oldAnimTrack = nil
  1851. local animTable = {}
  1852. local animNames = {
  1853. idle = {
  1854. { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
  1855. { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
  1856. },
  1857. walk = {
  1858. { id = "rbxassetid://4448762599", weight = 10 }
  1859. },
  1860. run = {
  1861. { id = "rbxassetid://4448762599", weight = 10 }
  1862. },
  1863. jump = {
  1864. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  1865. },
  1866. fall = {
  1867. { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
  1868. },
  1869. climb = {
  1870. { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
  1871. },
  1872. toolnone = {
  1873. { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
  1874. },
  1875. toolslash = {
  1876. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  1877. -- { id = "slash.xml", weight = 10 }
  1878. },
  1879. toollunge = {
  1880. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  1881. },
  1882. }
  1883.  
  1884. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1885. local emoteNames = { wave = false, point = false, dance = true, laugh = false, cheer = false}
  1886.  
  1887. math.randomseed(tick())
  1888.  
  1889. -- Setup animation objects
  1890. for name, fileList in pairs(animNames) do
  1891. animTable[name] = {}
  1892. animTable[name].count = 0
  1893. animTable[name].totalWeight = 0
  1894.  
  1895. -- check for config values
  1896. local config = script:FindFirstChild(name)
  1897. if (config ~= nil) then
  1898. -- print("Loading anims " .. name)
  1899. local idx = 1
  1900. for _, childPart in pairs(config:GetChildren()) do
  1901. animTable[name][idx] = {}
  1902. animTable[name][idx].anim = childPart
  1903. local weightObject = childPart:FindFirstChild("Weight")
  1904. if (weightObject == nil) then
  1905. animTable[name][idx].weight = 1
  1906. else
  1907. animTable[name][idx].weight = weightObject.Value
  1908. end
  1909. animTable[name].count = animTable[name].count + 1
  1910. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1911. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1912. idx = idx + 1
  1913. end
  1914. end
  1915.  
  1916. -- fallback to defaults
  1917. if (animTable[name].count <= 0) then
  1918. for idx, anim in pairs(fileList) do
  1919. animTable[name][idx] = {}
  1920. animTable[name][idx].anim = Instance.new("Animation")
  1921. animTable[name][idx].anim.Name = name
  1922. animTable[name][idx].anim.AnimationId = anim.id
  1923. animTable[name][idx].weight = anim.weight
  1924. animTable[name].count = animTable[name].count + 1
  1925. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1926. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1927. end
  1928. end
  1929. end
  1930.  
  1931. -- ANIMATION
  1932.  
  1933. -- declarations
  1934. local toolAnim = "None"
  1935. local toolAnimTime = 0
  1936.  
  1937. local jumpAnimTime = 0
  1938. local jumpAnimDuration = 0.175
  1939.  
  1940. local toolTransitionTime = 0.1
  1941. local fallTransitionTime = 0.2
  1942. local jumpMaxLimbVelocity = 0.75
  1943.  
  1944. -- functions
  1945.  
  1946. function stopAllAnimations()
  1947. local oldAnim = currentAnim
  1948.  
  1949. -- return to idle if finishing an emote
  1950. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1951. oldAnim = "idle"
  1952. end
  1953.  
  1954. currentAnim = ""
  1955. if (currentAnimKeyframeHandler ~= nil) then
  1956. currentAnimKeyframeHandler:disconnect()
  1957. end
  1958.  
  1959. if (oldAnimTrack ~= nil) then
  1960. oldAnimTrack:Stop()
  1961. oldAnimTrack:Destroy()
  1962. oldAnimTrack = nil
  1963. end
  1964. if (currentAnimTrack ~= nil) then
  1965. currentAnimTrack:Stop()
  1966. currentAnimTrack:Destroy()
  1967. currentAnimTrack = nil
  1968. end
  1969. return oldAnim
  1970. end
  1971.  
  1972. function keyFrameReachedFunc(frameName)
  1973. if (frameName == "End") then
  1974. -- print("Keyframe : ".. frameName)
  1975. local repeatAnim = stopAllAnimations()
  1976. playAnimation(repeatAnim, 0.0, Humanoid)
  1977. end
  1978. end
  1979.  
  1980. -- Preload animations
  1981. function playAnimation(animName, transitionTime, humanoid)
  1982. if (animName ~= currentAnim) then
  1983.  
  1984. if (oldAnimTrack ~= nil) then
  1985. oldAnimTrack:Stop()
  1986. oldAnimTrack:Destroy()
  1987. end
  1988.  
  1989. local roll = math.random(1, animTable[animName].totalWeight)
  1990. local origRoll = roll
  1991. local idx = 1
  1992. while (roll > animTable[animName][idx].weight) do
  1993. roll = roll - animTable[animName][idx].weight
  1994. idx = idx + 1
  1995. end
  1996. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1997. local anim = animTable[animName][idx].anim
  1998.  
  1999. -- load it to the humanoid; get AnimationTrack
  2000. oldAnimTrack = currentAnimTrack
  2001. currentAnimTrack = humanoid:LoadAnimation(anim)
  2002.  
  2003. -- play the animation
  2004. currentAnimTrack:Play(transitionTime)
  2005. currentAnim = animName
  2006.  
  2007. -- set up keyframe name triggers
  2008. if (currentAnimKeyframeHandler ~= nil) then
  2009. currentAnimKeyframeHandler:disconnect()
  2010. end
  2011. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  2012. end
  2013. end
  2014.  
  2015. -------------------------------------------------------------------------------------------
  2016. -------------------------------------------------------------------------------------------
  2017.  
  2018. local toolAnimName = ""
  2019. local toolOldAnimTrack = nil
  2020. local toolAnimTrack = nil
  2021. local currentToolAnimKeyframeHandler = nil
  2022.  
  2023. function toolKeyFrameReachedFunc(frameName)
  2024. if (frameName == "End") then
  2025. -- print("Keyframe : ".. frameName)
  2026. local repeatAnim = stopToolAnimations()
  2027. playToolAnimation(repeatAnim, 0.0, Humanoid)
  2028. end
  2029. end
  2030.  
  2031.  
  2032. function playToolAnimation(animName, transitionTime, humanoid)
  2033. if (animName ~= toolAnimName) then
  2034.  
  2035. if (toolAnimTrack ~= nil) then
  2036. toolAnimTrack:Stop()
  2037. toolAnimTrack:Destroy()
  2038. transitionTime = 0
  2039. end
  2040.  
  2041. local roll = math.random(1, animTable[animName].totalWeight)
  2042. local origRoll = roll
  2043. local idx = 1
  2044. while (roll > animTable[animName][idx].weight) do
  2045. roll = roll - animTable[animName][idx].weight
  2046. idx = idx + 1
  2047. end
  2048. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  2049. local anim = animTable[animName][idx].anim
  2050.  
  2051. -- load it to the humanoid; get AnimationTrack
  2052. toolOldAnimTrack = toolAnimTrack
  2053. toolAnimTrack = humanoid:LoadAnimation(anim)
  2054.  
  2055. -- play the animation
  2056. toolAnimTrack:Play(transitionTime)
  2057. toolAnimName = animName
  2058.  
  2059. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  2060. end
  2061. end
  2062.  
  2063. function stopToolAnimations()
  2064. local oldAnim = toolAnimName
  2065.  
  2066. if (currentToolAnimKeyframeHandler ~= nil) then
  2067. currentToolAnimKeyframeHandler:disconnect()
  2068. end
  2069.  
  2070. toolAnimName = ""
  2071. if (toolAnimTrack ~= nil) then
  2072. toolAnimTrack:Stop()
  2073. toolAnimTrack:Destroy()
  2074. toolAnimTrack = nil
  2075. end
  2076.  
  2077.  
  2078. return oldAnim
  2079. end
  2080.  
  2081. -------------------------------------------------------------------------------------------
  2082. -------------------------------------------------------------------------------------------
  2083.  
  2084.  
  2085. function onRunning(speed)
  2086. if speed>0 then
  2087. playAnimation("walk", 0.1, Humanoid)
  2088. pose = "Running"
  2089. else
  2090. playAnimation("idle", 0.1, Humanoid)
  2091. pose = "Standing"
  2092. end
  2093. end
  2094.  
  2095. function onDied()
  2096. pose = "Dead"
  2097. end
  2098.  
  2099. function onJumping()
  2100. playAnimation("jump", 0.1, Humanoid)
  2101. jumpAnimTime = jumpAnimDuration
  2102. pose = "Jumping"
  2103. end
  2104.  
  2105. function onClimbing()
  2106. playAnimation("climb", 0.1, Humanoid)
  2107. pose = "Climbing"
  2108. end
  2109.  
  2110. function onGettingUp()
  2111. pose = "GettingUp"
  2112. end
  2113.  
  2114. function onFreeFall()
  2115. if (jumpAnimTime <= 0) then
  2116. playAnimation("fall", fallTransitionTime, Humanoid)
  2117. end
  2118. pose = "FreeFall"
  2119. end
  2120.  
  2121. function onFallingDown()
  2122. pose = "FallingDown"
  2123. end
  2124.  
  2125. function onSeated()
  2126. pose = "Seated"
  2127. end
  2128.  
  2129. function onPlatformStanding()
  2130. pose = "PlatformStanding"
  2131. end
  2132.  
  2133. function onSwimming(speed)
  2134. if speed>0 then
  2135. pose = "Running"
  2136. else
  2137. pose = "Standing"
  2138. end
  2139. end
  2140.  
  2141. function getTool()
  2142. for _, kid in ipairs(Figure:GetChildren()) do
  2143. if kid.className == "Tool" then return kid end
  2144. end
  2145. return nil
  2146. end
  2147.  
  2148. function getToolAnim(tool)
  2149. for _, c in ipairs(tool:GetChildren()) do
  2150. if c.Name == "toolanim" and c.className == "StringValue" then
  2151. return c
  2152. end
  2153. end
  2154. return nil
  2155. end
  2156.  
  2157. function animateTool()
  2158.  
  2159. if (toolAnim == "None") then
  2160. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  2161. return
  2162. end
  2163.  
  2164. if (toolAnim == "Slash") then
  2165. playToolAnimation("toolslash", 0, Humanoid)
  2166. return
  2167. end
  2168.  
  2169. if (toolAnim == "Lunge") then
  2170. playToolAnimation("toollunge", 0, Humanoid)
  2171. return
  2172. end
  2173. end
  2174.  
  2175. function moveSit()
  2176. RightShoulder.MaxVelocity = 0.15
  2177. LeftShoulder.MaxVelocity = 0.15
  2178. RightShoulder:SetDesiredAngle(3.14 /2)
  2179. LeftShoulder:SetDesiredAngle(-3.14 /2)
  2180. RightHip:SetDesiredAngle(3.14 /2)
  2181. LeftHip:SetDesiredAngle(-3.14 /2)
  2182. end
  2183.  
  2184. local lastTick = 0
  2185.  
  2186. function move(time)
  2187. local amplitude = 1
  2188. local frequency = 1
  2189. local deltaTime = time - lastTick
  2190. lastTick = time
  2191.  
  2192. local climbFudge = 0
  2193. local setAngles = false
  2194.  
  2195. if (jumpAnimTime > 0) then
  2196. jumpAnimTime = jumpAnimTime - deltaTime
  2197. end
  2198.  
  2199. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  2200. playAnimation("fall", fallTransitionTime, Humanoid)
  2201. elseif (pose == "Seated") then
  2202. stopAllAnimations()
  2203. moveSit()
  2204. return
  2205. elseif (pose == "Running") then
  2206. playAnimation("walk", 0.1, Humanoid)
  2207. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  2208. -- print("Wha " .. pose)
  2209. amplitude = 0.1
  2210. frequency = 1
  2211. setAngles = true
  2212. end
  2213.  
  2214. if (setAngles) then
  2215. desiredAngle = amplitude * math.sin(time * frequency)
  2216.  
  2217. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  2218. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  2219. RightHip:SetDesiredAngle(-desiredAngle)
  2220. LeftHip:SetDesiredAngle(-desiredAngle)
  2221. end
  2222.  
  2223. -- Tool Animation handling
  2224. local tool = getTool()
  2225. if tool then
  2226.  
  2227. animStringValueObject = getToolAnim(tool)
  2228.  
  2229. if animStringValueObject then
  2230. toolAnim = animStringValueObject.Value
  2231. -- message recieved, delete StringValue
  2232. animStringValueObject.Parent = nil
  2233. toolAnimTime = time + .3
  2234. end
  2235.  
  2236. if time > toolAnimTime then
  2237. toolAnimTime = 0
  2238. toolAnim = "None"
  2239. end
  2240.  
  2241. animateTool()
  2242. else
  2243. stopToolAnimations()
  2244. toolAnim = "None"
  2245. toolAnimTime = 0
  2246. end
  2247. end
  2248.  
  2249. -- connect events
  2250. Humanoid.Died:connect(onDied)
  2251. Humanoid.Running:connect(onRunning)
  2252. Humanoid.Jumping:connect(onJumping)
  2253. Humanoid.Climbing:connect(onClimbing)
  2254. Humanoid.GettingUp:connect(onGettingUp)
  2255. Humanoid.FreeFalling:connect(onFreeFall)
  2256. Humanoid.FallingDown:connect(onFallingDown)
  2257. Humanoid.Seated:connect(onSeated)
  2258. Humanoid.PlatformStanding:connect(onPlatformStanding)
  2259. Humanoid.Swimming:connect(onSwimming)
  2260.  
  2261.  
  2262. -- main program
  2263.  
  2264. local runService = game:service("RunService");
  2265.  
  2266. -- initialize to idle
  2267. playAnimation("idle", 0.1, Humanoid)
  2268. pose = "Standing"
  2269.  
  2270. while Figure.Parent~=nil do
  2271. local _, time = wait(0.1)
  2272. move(time)
  2273. end end;}local ActualScripts = {}
  2274. function s(var)
  2275. local func = table.remove(Scripts,1)
  2276. setfenv(func,setmetatable({script=var,require=fake_require or require,global=genv},{
  2277. __index = getfenv(func),
  2278. }))
  2279. table.insert(ActualScripts,coroutine.wrap(func))
  2280. end
  2281. Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  2282. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  2283. function(t,f)
  2284. for a,b in pairs(t) do
  2285. f(a,b)
  2286. end
  2287. end
  2288. local Types = {
  2289. Color3 = Color3.new,
  2290. Vector3 = Vector3.new,
  2291. Vector2 = Vector2.new,
  2292. UDim = UDim.new,
  2293. UDim2 = UDim2.new,
  2294. CFrame = CFrame.new,
  2295. Rect = Rect.new,
  2296. NumberRange = NumberRange.new,
  2297. BrickColor = BrickColor.new,
  2298. PhysicalProperties = PhysicalProperties.new,
  2299. NumberSequence = function(...)
  2300. local a = {...}
  2301. local t = {}
  2302. repeat
  2303. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  2304. until #a==0
  2305. return NumberSequence.new(t)
  2306. end,
  2307. ColorSequence = function(...)
  2308. local a = {...}
  2309. local t = {}
  2310. repeat
  2311. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  2312. until #a==0
  2313. return ColorSequence.new(t)
  2314. end,
  2315. number = tonumber,
  2316. boolean = function(a)
  2317. return a=="1"
  2318. end
  2319. }
  2320. split = function(str,sep)
  2321. if not str then return end
  2322. local fields = {}
  2323. local ConcatNext = false
  2324. str:gsub(("([^%s]+)"):format(sep),function(c)
  2325. if ConcatNext == true then
  2326. fields[#fields] = fields[#fields]..sep..c
  2327. ConcatNext = false
  2328. else
  2329. fields[#fields+1] = c
  2330. end
  2331. if c:sub(#c)=="\\" then
  2332. c = fields[#fields]
  2333. fields[#fields] = c:sub(1,#c-1)
  2334. ConcatNext = true
  2335. end
  2336. end)
  2337. return fields
  2338. end
  2339. RemoveAndSplit = function(t)
  2340. return split(table_remove(t,1),comma)
  2341. end
  2342. t = split(str,";")
  2343. props = RemoveAndSplit(t)
  2344. classes = RemoveAndSplit(t)
  2345. values = split(table_remove(t,1),'|')
  2346. ICList = RemoveAndSplit(t)
  2347. InstanceList = {}
  2348. Model = inst"Model"
  2349. CurPar = Model
  2350. table_foreach(t,function(ct,c)
  2351. if c=="n" or c=="p" then
  2352. CurPar = c=="n" and LastIns or CurPar[parnt]
  2353. else
  2354. ct = split(c,"|")
  2355. local class = classes[tonum(table_remove(ct,1))]
  2356. if class=="UnionOperation" then
  2357. LastIns = {UsePartColor="1"}
  2358. else
  2359. LastIns = inst(class)
  2360. if LastIns:IsA"Script" then
  2361. s(LastIns)
  2362. elseif LastIns:IsA("ModuleScript") then
  2363. ms(LastIns)
  2364. end
  2365. end
  2366.  
  2367. local function SetProperty(LastIns,p,str,s)
  2368. s = Types[typeof(LastIns[p])]
  2369. if p=="CustomPhysicalProperties" then
  2370. s = PhysicalProperties.new
  2371. end
  2372. if s then
  2373. LastIns[p] = s(unpack(split(str,comma)))
  2374. else
  2375. LastIns[p] = str
  2376. end
  2377. end
  2378.  
  2379. local UnionData
  2380. table_foreach(ct,function(s,p,a,str)
  2381. a = p:find":"
  2382. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  2383. if p=="UnionData" then
  2384. UnionData = split(str," ")
  2385. return
  2386. end
  2387. if class=="UnionOperation" then
  2388. LastIns[p] = str
  2389. return
  2390. end
  2391. SetProperty(LastIns,p,str)
  2392. end)
  2393.  
  2394. if UnionData then
  2395. local LI_Data = LastIns
  2396. LastIns = DecodeUnion(UnionData)
  2397. table_foreach(LI_Data,function(p,str)
  2398. SetProperty(LastIns,p,str)
  2399. end)
  2400. end
  2401. table.insert(InstanceList,LastIns)
  2402. LastIns[parnt] = CurPar
  2403. end
  2404. end)
  2405. table_remove(ICList,1)
  2406. table_foreach(ICList,function(a,b)
  2407. b = split(b,">")
  2408. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  2409. end)
  2410.  
  2411. return Model:GetChildren()
  2412. end
  2413.  
  2414. local Objects = Decode('Name,PrimaryPart,Color,Transparency,Position,Orientation,Size,BottomSurface,TopSurface,MaxVelocity,C0,C1,Part0,Part1,BackgroundColor3,BackgroundTransparency,Image,DesiredAngle,Material,MeshType,CanCol'
  2415. ..'lide,Scale,MeshId,BodyPart,DisplayDistanceType,HealthDisplayDistance,NameDisplayDistance,NameOcclusion,Health,MaxHealth,JumpPower,MaxSlopeAngle,AnimationId,SoundId,Volume,Value,MaxDistance,EmitterSize'
  2416. ..',Looped,PlaybackSpeed;Part,Model,Motor6D,ScreenGui,Frame,ImageLabel,Script,MeshPart,SpecialMesh,WeldConstraint,CharacterMesh,Humanoid,Animation,Sound,IntValue,StringValue,NumberValue;Part|Siren head|H'
  2417. ..'umanoidRootPart|0.6078,0.5215,0.7019|1|-51.9737,11.3007,159.967|0.0099,1.9099,0|7.3981,7.3981,3.699|0|Root Hip|0.1|0,0,0,-1,0,0,0,0,1,0,1,-0|Torso|Popup|BackGround|0,0,-0.1001,0|1.1,0,1.2,0|0.1098,0.1'
  2418. ..'098,0.1098|Image|0.001,0,0.05,0|1,0,1,0|0,0,0|rbxassetid://1214897532|qPerfectionWeld|Right Shoulder|3.699,1.8495,0,-0.0001,0,1,-0,0.9999,0,-1,0,-0.0001|-1.8496,1.8495,0,-0.0001,0,1,0,0.9999,0,-1,0,-0'
  2419. ..'.0001|0.0427|Neck|0,3.699,0,-1,0,0,0,0,1,0,1,-0|0,-1.8496,0,-1,0,0,0,0,1,0,1,-0|Left Hip|-3.6991,-3.6991,0,-0.0001,0,-1,0,0.9999,0,1,0,-0.0001|-1.8496,3.699,0,-0.0001,0,-1,0,0.9999,0,1,0,-0.0001|-0.04'
  2420. ..'28|Right Hip|3.699,-3.6991,0,-0.0001,0,1,-0,0.9999,0,-1,0,-0.0001|1.8495,3.699,0,-0.0001,0,1,0,0.9999,0,-1,0,-0.0001|Left Shoulder|-3.6991,1.8495,0,-0.0001,0,-1,0,0.9999,0,1,0,-0.0001|1.8495,1.8495,0,'
  2421. ..'-0.0001,0,-1,0,0.9999,0,1,0,-0.0001|tso|0.4117,0.2509,0.1568|832|-51.7082,12.69,160.0926|-8.48,-1.7301,0.75|2.9455,1.7317,1.9263|-52.5528,16.2581,160.171|-7.7801,178.4799,-36.8601|3.3934,1.1191,2.0938'
  2422. ..'|3|-51.9495,14.3117,160.4001|-7.8801,178.4799,1.5399|0.8348,5.4149,2.4346|-50.6161,18.7258,160.3554|0.7599,-2.4801,-13.3501|3.8627,1.4079,2.3826|-50.7426,18.1108,160.3416|0.7699,-2.4801,-18.38|-51.840'
  2423. ..'1,17.9104,160.443|1.1191,4.1515,2.7797|-52.5753,16.8011,160.2507|-7.77,178.4799,-31.2801|3.8266,1.1191,2.2382|-52.9052,17.5462,160.2284|-7.7801,178.4799,-17|3.6822,1.1191,2.4909|-51.0196,16.3332,160.2'
  2424. ..'449|0.7799,-2.4901,-36.9001|3.249,1.2274,2.2021|-52.8557,18.1321,160.2875|-7.79,178.4799,-14.48|3.7183,1.3717,2.4187|-52.8965,17.1278,160.1552|-7.7801,178.4799,-26.82|3.6822,1.1191,2.3465|-50.6882,18.'
  2425. ..'4707,160.3469|0.7599,-2.4801,-18.38|-52.8762,18.8843,160.2986|-7.77,178.4799,-9.25|3.3934,1.1191,2.2382|-51.0318,16.8441,160.2824|0.7799,-2.4901,-31.9|3.6822,1.1191,2.2743|-50.8549,17.7286,160.2841|0.'
  2426. ..'7599,-2.4801,-23.7801|3.8627,1.4079,2.3104|-50.9632,17.307,160.2796|-51.7641,14.7299,160.211|-1.52,178.3999,-90.74|6.3737,3.1074,2.176|-52.9072,18.5696,160.253|3.5378,1.1191,2.2382|Left Leg|-53.8219,3'
  2427. ..'.9025,160.0272|3.699,7.3981,3.699|0|leftl|-52.9324,3.4534,160.3895|-0.6001,0,0.8399|0.9125,6.655,1.6071|-53.0119,9.4129,160.3625|0.9125,6.1867,1.0402|Right Leg|-50.1249,3.9026,159.9041|rightl|-50.5625'
  2428. ..',3.486,160.3923|-50.6488,9.4613,160.4234|0.9125,6.162,0.917|Left Arm|-57.5192,11.3005,160.1517|4.9293,4.9293,4.9293|http://www.roblox.com/asset/?id=36780032|5|lefta|0.4588,0,0|864|-56.9372,4.4286,159.'
  2429. ..'0953|-5.62,178.82,17.1299|1.3822,4.5855,2.8487|-56.3905,10.859,159.8978|4.5199,-0.82,-5.1701|1.1413,6.6838,1.5631|-57.0682,4.4685,159.0592|1.3822,4.5855,2.9226|-56.636,7.8479,159.5653|-4.52,179.1799,-'
  2430. ..'84.81|3.5875,1.2836,1.5349|-55.2521,16.0515,160.2993|-4.5101,179.1699,-80.4701|7.3694,1.0125,1.6582|Alien torso|27493004|1|Health|2|inf|60|89.9|Status|AvalibleSpawns|SirenHeadMain|Respawn|Swing|rbxass'
  2431. ..'etid://4736855789|Superhero Right Leg|32328627|Superhero Left Leg|32328520|4|Head|-51.9739,16.8493,159.968|7.3981,3.699,3.699|Luagh|rbxassetid://634710465|10|Enabled|1.25,1.25,1.25|Mouth|1568|-51.9334'
  2432. ..',23.7274,160.1146|0.0099,0,0|4.8813,3.0504,2.2098|Damage Script|80|5|0.8|rbxassetid://3217273640|3|sirenhead|-51.9333,22.6297,160.1144|4.9244,6.3875,2.7764|rbxassetid://3431391190|Right Arm|-46.4281,1'
  2433. ..'1.3009,159.7823|http://www.roblox.com/asset/?id=36780156|righta|-46.8734,4.485,158.9918|8.4799,-2.9301,13.1199|-47.6357,10.8557,159.512|-6.95,-173.7101,-5.1101|-47.4166,7.8389,159.2099|6.9499,6.2899,-'
  2434. ..'84.8701|-48.6977,16.0351,160.2935|6.9499,6.2899,-80.5101|-46.7429,4.5085,159.0378|8.4799,-2.9301,13.14|Animate|climb|ClimbAnim|http://www.roblox.com/asset/?id=125750800|fall|FallAnim|http://www.roblox'
  2435. ..'.com/asset/?id=125750759|idle|Animation1|http://www.roblox.com/asset/?id=125750544|Weight|9|Animation2|http://www.roblox.com/asset/?id=125750618|jump|JumpAnim|http://www.roblox.com/asset/?id=125750702'
  2436. ..'|run|RunAnim|rbxassetid://4448762599|toolnone|ToolNoneAnim|http://www.roblox.com/asset/?id=125750867|walk|WalkAnim;0,1>2>2,3>13>2,3>14>4,9>13>4,9>14>211,10>13>4,10>14>200,11>13>4,11>14>166,12>13>4,12>'
  2437. ..'14>171,13>13>4,13>14>176,14>2>153,18>13>16,18>14>112,19>13>16,19>14>62,20>13>16,20>14>28,21>13>16,21>14>117,22>13>16,22>14>65,23>13>16,23>14>141,24>13>16,24>14>34,25>13>16,25>14>50,26>13>16,26>14>42,2'
  2438. ..'7>13>16,27>14>91,32>13>30,32>14>62,33>13>30,33>14>91,36>13>34,36>14>112,37>13>34,37>14>62,38>13>34,38>14>117,39>13>34,39>14>30,40>13>34,40>14>42,41>13>34,41>14>91,44>13>42,44>14>112,45>13>42,45>14>62,'
  2439. ..'46>13>42,46>14>28,47>13>42,47>14>117,48>13>42,48>14>30,49>13>42,49>14>91,52>13>50,52>14>112,53>13>50,53>14>62,54>13>50,54>14>28,55>13>50,55>14>117,56>13>50,56>14>141,57>13>50,57>14>34,58>13>50,58>14>3'
  2440. ..'0,59>13>50,59>14>42,60>13>50,60>14>91,61>13>50,61>14>94,64>13>62,64>14>91,67>13>65,67>14>112,68>13>65,68>14>62,69>13>65,69>14>28,70>13>65,70>14>117,71>13>65,71>14>141,72>13>65,72>14>34,73>13>65,73>14>'
  2441. ..'50,74>13>65,74>14>42,75>13>65,75>14>91,78>13>76,78>14>112,79>13>76,79>14>62,80>13>76,80>14>117,81>13>76,81>14>65,82>13>76,82>14>141,83>13>76,83>14>34,84>13>76,84>14>50,85>13>76,85>14>153,86>13>76,86>1'
  2442. ..'4>103,87>13>76,87>14>30,88>13>76,88>14>42,89>13>76,89>14>91,90>13>76,90>14>94,93>13>91,93>14>28,96>13>94,96>14>112,97>13>94,97>14>62,98>13>94,98>14>117,99>13>94,99>14>34,100>13>94,100>14>30,101>13>94,'
  2443. ..'101>14>42,102>13>94,102>14>91,105>13>103,105>14>112,106>13>103,106>14>62,107>13>103,107>14>117,108>13>103,108>14>34,109>13>103,109>14>30,110>13>103,110>14>42,111>13>103,111>14>94,114>13>112,114>14>62,'
  2444. ..'115>13>112,115>14>28,116>13>112,116>14>91,119>13>117,119>14>112,120>13>117,120>14>62,121>13>117,121>14>30,122>13>117,122>14>91,125>13>123,125>14>112,126>13>123,126>14>62,127>13>123,127>14>28,128>13>12'
  2445. ..'3,128>14>117,129>13>123,129>14>65,130>13>123,130>14>16,131>13>123,131>14>141,132>13>123,132>14>34,133>13>123,133>14>50,134>13>123,134>14>153,135>13>123,135>14>103,136>13>123,136>14>30,137>13>123,137>1'
  2446. ..'4>42,138>13>123,138>14>91,139>13>123,139>14>76,140>13>123,140>14>94,143>13>141,143>14>112,144>13>141,144>14>62,145>13>141,145>14>28,146>13>141,146>14>117,147>13>141,147>14>34,148>13>141,148>14>15,149>'
  2447. ..'13>141,149>14>30,150>13>141,150>14>42,151>13>141,151>14>91,152>13>141,152>14>94,155>13>153,155>14>112,156>13>153,156>14>62,157>13>153,157>14>117,158>13>153,158>14>141,159>13>153,159>14>34,160>13>153,1'
  2448. ..'60>14>50,161>13>153,161>14>103,162>13>153,162>14>30,163>13>153,163>14>42,164>13>153,164>14>91,165>13>153,165>14>94,168>2>170,173>2>175,180>2>187,186>13>184,186>14>182,189>13>187,205>2>209,214>2>220,21'
  2449. ..'9>13>217,219>14>216,222>13>220;2|1:2;n;1|1:3|3:4|4:5|5:6|6:7|7:8|8:9|9:9|3:4|3:4;n;3|1:10|10:11|11:12|12:12;p;1|1:13|3:4|4:5|5:6|6:7|7:8|8:9|9:9|3:4|3:4;n;4|1:14;n;5|1:15|5:16|7:17|15:18|16:5;n;6|1:19'
  2450. ..'|5:20|7:21|15:22|16:5|17:23;p;p;7|1:24;3|1:25|10:11|11:26|12:27|18:28;3|1:29|10:11|11:30|12:31;3|1:32|10:11|11:33|12:34|18:35;3|1:36|10:11|11:37|12:38|18:35;3|1:39|10:11|11:40|12:41|18:28;2|1:42;n;8|3'
  2451. ..':43|19:44|5:45|6:46|7:47|3:43|3:43;1|3:43|19:44|5:48|6:49|7:50|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;p;1|3:43|19:44|5:52|6:53|7:54|8:9|9:9|3:43|3:43;n;9|20:51;p;1|3:43|19:44|5:55|6'
  2452. ..':56|7:57|8:9|9:9|3:43|3:43;n;9|20:51;10;10;p;1|3:43|19:44|5:58|6:59|7:57|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;p;1|3:43|19:44|5:60|6:53|7:61|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;p;1|3'
  2453. ..':43|19:44|5:62|6:63|7:64|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;p;1|3:43|19:44|5:65|6:66|7:67|8:9|9:9|3:43|3:43;n;9|20:51;10;p;1|3:43|19:44|5:68|6:69|7:70|8:9|9:9|3:43|3:43;n;9|20:5'
  2454. ..'1;10;10;10;10;10;10;10;10;10;p;1|3:43|19:44|5:71|6:72|7:73|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;10;10;10;p;1|3:43|19:44|5:74|6:75|7:76|8:9|9:9|3:43|3:43;n;9|20:51;10;p;1|3:43|19:4'
  2455. ..'4|5:77|6:78|7:57|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;p;1|3:43|19:44|5:79|6:80|7:81|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;p;1|3:43|19:44|5:82|6:83|7:84|8:9|9:9|3:43|3:43;n;9|20:'
  2456. ..'51;10;10;10;p;1|3:43|19:44|5:85|6:86|7:87|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;p;1|3:43|19:44|5:88|6:83|7:87|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;p;1|3:43|19:'
  2457. ..'44|5:89|6:90|7:91|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;p;1|3:43|19:44|5:92|6:80|7:93|8:9|9:9|3:43|3:43;n;9|20:51;10;10;10;10;10;10;10;10;10;10;10;p;p;p;1|1:94|3:4|4:5|5:95|6:7|7:9'
  2458. ..'6|21:97|8:9|9:9|3:4|3:4;n;7|1:24;2|1:98;n;8|3:43|19:44|5:99|6:100|7:101|3:43|3:43;8|3:43|19:44|5:102|6:100|7:103|3:43|3:43;p;p;1|1:104|3:4|4:5|5:105|6:7|7:96|21:97|8:9|9:9|3:4|3:4;n;7|1:24;2|1:106;n;8'
  2459. ..'|3:43|19:44|5:107|6:100|7:101|3:43|3:43;8|3:43|19:44|5:108|6:100|7:109|3:43|3:43;p;p;1|1:110|3:4|4:5|5:111|6:7|7:96|21:97|8:9|9:9|3:4|3:4;n;9|22:112|23:113|20:114;7|1:24;2;2|1:115;n;8|3:116|19:117|5:1'
  2460. ..'18|6:119|7:120|3:116|3:116;8|3:43|19:44|5:121|6:122|7:123|3:43|3:43;8|3:43|19:44|5:124|6:119|7:125|3:43|3:43;1|3:43|19:44|5:126|6:127|7:128|8:9|9:9|3:43|3:43;n;9|20:51;10;p;1|3:43|19:44|5:129|6:130|7:'
  2461. ..'131|8:9|9:9|3:43|3:43;n;9|20:51;10;p;p;p;11|1:132|23:133|24:134;7|1:135;12|25:136|26:97|27:97|28:134|29:137|30:137|31:138|32:139;n;2|1:140;n;2|1:141;p;p;7|1:142;7|1:143;13|1:144|33:145;11|1:146|23:147'
  2462. ..'|24:114;11|1:148|23:149|24:150;1|1:151|3:4|4:5|5:152|6:7|7:153|8:9|9:9|3:4|3:4;n;14|1:154|34:155|35:156;15|1:157|36:5;9|22:158;7|1:24;2;n;8|1:159|19:160|5:161|6:162|7:163;n;7|1:164;14|37:165|38:166|39'
  2463. ..':5|37:165|40:167|34:168|35:169;p;8|1:170|3:43|19:44|5:171|6:162|7:172|3:43|3:43;p;p;13|1:144|33:173;1|1:174|3:4|4:5|5:175|6:7|7:96|21:97|8:9|9:9|3:4|3:4;n;9|22:112|23:176|20:114;7|1:24;2|1:177;n;8|3:1'
  2464. ..'16|19:117|5:178|6:179|7:120|3:116|3:116;8|3:43|19:44|5:180|6:181|7:123|3:43|3:43;1|3:43|19:44|5:182|6:183|7:128|8:9|9:9|3:43|3:43;n;9|20:51;10;p;1|3:43|19:44|5:184|6:185|7:131|8:9|9:9|3:43|3:43;n;9|20'
  2465. ..':51;10;p;8|3:43|19:44|5:186|6:187|7:125|3:43|3:43;p;p;7|1:188;n;16|1:189;n;13|1:190|33:191;p;16|1:192;n;13|1:193|33:194;p;16|1:195;n;13|1:196|33:197;n;17|1:198|36:199;p;13|1:200|33:201;n;17|1:198|36:5'
  2466. ..';p;p;16|1:202;n;13|1:203|33:204;p;16|1:205;n;13|1:206|33:207;p;16|1:208;n;13|1:209|33:210;p;16|1:211;n;13|1:212|33:207;p;p;p;')
  2467. for _,Object in pairs(Objects) do
  2468. Object.Parent = script and script.Parent==workspace and script or workspace
  2469. end
  2470. for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement