Advertisement
lafur

Untitled

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