antoniorigo4

scriptie

Jan 27th, 2019
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.90 KB | None | 0 0
  1. --a ibm 7090 for script builder lol roblox
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Model1 = Instance.new("Model")
  21. Part2 = Instance.new("Part")
  22. Part3 = Instance.new("Part")
  23. Part4 = Instance.new("Part")
  24. Part5 = Instance.new("Part")
  25. Part6 = Instance.new("Part")
  26. Part7 = Instance.new("Part")
  27. Part8 = Instance.new("Part")
  28. Part9 = Instance.new("Part")
  29. Part10 = Instance.new("Part")
  30. Script11 = Instance.new("Script")
  31. Part12 = Instance.new("Part")
  32. Sound13 = Instance.new("Sound")
  33. Script14 = Instance.new("Script")
  34. Model15 = Instance.new("Model")
  35. Model16 = Instance.new("Model")
  36. Part17 = Instance.new("Part")
  37. HingeConstraint18 = Instance.new("HingeConstraint")
  38. Part19 = Instance.new("Part")
  39. Part20 = Instance.new("Part")
  40. Part21 = Instance.new("Part")
  41. Part22 = Instance.new("Part")
  42. Part23 = Instance.new("Part")
  43. Script24 = Instance.new("Script")
  44. Model25 = Instance.new("Model")
  45. Part26 = Instance.new("Part")
  46. Part27 = Instance.new("Part")
  47. Part28 = Instance.new("Part")
  48. Part29 = Instance.new("Part")
  49. Part30 = Instance.new("Part")
  50. Part31 = Instance.new("Part")
  51. HingeConstraint32 = Instance.new("HingeConstraint")
  52. Script33 = Instance.new("Script")
  53. Script34 = Instance.new("Script")
  54. Model0.Name = "IBM 7090"
  55. Model0.Parent = mas
  56. Model1.Name = "Body"
  57. Model1.Parent = Model0
  58. Part2.Parent = Model1
  59. Part2.CFrame = CFrame.new(-5.9187088, 2.50000596, -11.8352461, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  60. Part2.Orientation = Vector3.new(0, 180, 0)
  61. Part2.Position = Vector3.new(-5.9187088, 2.50000596, -11.8352461)
  62. Part2.Rotation = Vector3.new(-180, 0, -180)
  63. Part2.Size = Vector3.new(2, 5, 4.34000063)
  64. Part2.Anchored = true
  65. Part2.BottomSurface = Enum.SurfaceType.Smooth
  66. Part2.Locked = true
  67. Part2.TopSurface = Enum.SurfaceType.Smooth
  68. Part3.Parent = Model1
  69. Part3.CFrame = CFrame.new(-6.6687088, 3.50000596, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  70. Part3.Orientation = Vector3.new(0, 180, 0)
  71. Part3.Position = Vector3.new(-6.6687088, 3.50000596, -9.64023972)
  72. Part3.Rotation = Vector3.new(-180, 0, -180)
  73. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  74. Part3.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  75. Part3.Anchored = true
  76. Part3.BottomSurface = Enum.SurfaceType.Smooth
  77. Part3.BrickColor = BrickColor.new("Dark stone grey")
  78. Part3.Locked = true
  79. Part3.TopSurface = Enum.SurfaceType.Smooth
  80. Part3.brickColor = BrickColor.new("Dark stone grey")
  81. Part4.Parent = Model1
  82. Part4.CFrame = CFrame.new(-6.13870096, 3.50000596, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  83. Part4.Orientation = Vector3.new(0, 180, 0)
  84. Part4.Position = Vector3.new(-6.13870096, 3.50000596, -9.64023972)
  85. Part4.Rotation = Vector3.new(-180, 0, -180)
  86. Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  87. Part4.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  88. Part4.Anchored = true
  89. Part4.BottomSurface = Enum.SurfaceType.Smooth
  90. Part4.BrickColor = BrickColor.new("Dark stone grey")
  91. Part4.Locked = true
  92. Part4.TopSurface = Enum.SurfaceType.Smooth
  93. Part4.brickColor = BrickColor.new("Dark stone grey")
  94. Part5.Parent = Model1
  95. Part5.CFrame = CFrame.new(-5.22868967, 3.50000596, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  96. Part5.Orientation = Vector3.new(0, 180, 0)
  97. Part5.Position = Vector3.new(-5.22868967, 3.50000596, -9.64023972)
  98. Part5.Rotation = Vector3.new(-180, 0, -180)
  99. Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
  100. Part5.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  101. Part5.Anchored = true
  102. Part5.BottomSurface = Enum.SurfaceType.Smooth
  103. Part5.BrickColor = BrickColor.new("Dark stone grey")
  104. Part5.Locked = true
  105. Part5.TopSurface = Enum.SurfaceType.Smooth
  106. Part5.brickColor = BrickColor.new("Dark stone grey")
  107. Part6.Parent = Model1
  108. Part6.CFrame = CFrame.new(-5.75869799, 3.50000596, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  109. Part6.Orientation = Vector3.new(0, 180, 0)
  110. Part6.Position = Vector3.new(-5.75869799, 3.50000596, -9.64023972)
  111. Part6.Rotation = Vector3.new(-180, 0, -180)
  112. Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
  113. Part6.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  114. Part6.Anchored = true
  115. Part6.BottomSurface = Enum.SurfaceType.Smooth
  116. Part6.BrickColor = BrickColor.new("Dark stone grey")
  117. Part6.Locked = true
  118. Part6.TopSurface = Enum.SurfaceType.Smooth
  119. Part6.brickColor = BrickColor.new("Dark stone grey")
  120. Part7.Parent = Model1
  121. Part7.CFrame = CFrame.new(-5.22868967, 2.3600049, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  122. Part7.Orientation = Vector3.new(0, 180, 0)
  123. Part7.Position = Vector3.new(-5.22868967, 2.3600049, -9.64023972)
  124. Part7.Rotation = Vector3.new(-180, 0, -180)
  125. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  126. Part7.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  127. Part7.Anchored = true
  128. Part7.BottomSurface = Enum.SurfaceType.Smooth
  129. Part7.BrickColor = BrickColor.new("Dark stone grey")
  130. Part7.Locked = true
  131. Part7.TopSurface = Enum.SurfaceType.Smooth
  132. Part7.brickColor = BrickColor.new("Dark stone grey")
  133. Part8.Parent = Model1
  134. Part8.CFrame = CFrame.new(-5.75869799, 2.3600049, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  135. Part8.Orientation = Vector3.new(0, 180, 0)
  136. Part8.Position = Vector3.new(-5.75869799, 2.3600049, -9.64023972)
  137. Part8.Rotation = Vector3.new(-180, 0, -180)
  138. Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
  139. Part8.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  140. Part8.Anchored = true
  141. Part8.BottomSurface = Enum.SurfaceType.Smooth
  142. Part8.BrickColor = BrickColor.new("Dark stone grey")
  143. Part8.Locked = true
  144. Part8.TopSurface = Enum.SurfaceType.Smooth
  145. Part8.brickColor = BrickColor.new("Dark stone grey")
  146. Part9.Parent = Model1
  147. Part9.CFrame = CFrame.new(-6.69869804, 2.3600049, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  148. Part9.Orientation = Vector3.new(0, 180, 0)
  149. Part9.Position = Vector3.new(-6.69869804, 2.3600049, -9.64023972)
  150. Part9.Rotation = Vector3.new(-180, 0, -180)
  151. Part9.Color = Color3.new(0.388235, 0.372549, 0.384314)
  152. Part9.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  153. Part9.Anchored = true
  154. Part9.BottomSurface = Enum.SurfaceType.Smooth
  155. Part9.BrickColor = BrickColor.new("Dark stone grey")
  156. Part9.Locked = true
  157. Part9.TopSurface = Enum.SurfaceType.Smooth
  158. Part9.brickColor = BrickColor.new("Dark stone grey")
  159. Part10.Parent = Model1
  160. Part10.CFrame = CFrame.new(-6.16868973, 2.3600049, -9.64023972, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  161. Part10.Orientation = Vector3.new(0, 180, 0)
  162. Part10.Position = Vector3.new(-6.16868973, 2.3600049, -9.64023972)
  163. Part10.Rotation = Vector3.new(-180, 0, -180)
  164. Part10.Color = Color3.new(0.388235, 0.372549, 0.384314)
  165. Part10.Size = Vector3.new(0.299999863, 1, 0.0500000007)
  166. Part10.Anchored = true
  167. Part10.BottomSurface = Enum.SurfaceType.Smooth
  168. Part10.BrickColor = BrickColor.new("Dark stone grey")
  169. Part10.Locked = true
  170. Part10.TopSurface = Enum.SurfaceType.Smooth
  171. Part10.brickColor = BrickColor.new("Dark stone grey")
  172. Script11.Name = "qPerfectionWeld"
  173. Script11.Parent = Model1
  174. table.insert(cors,sandbox(Script11,function()
  175. -- Created by Quenty (@Quenty, follow me on twitter).
  176. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  177. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  178.  
  179. --[[ INSTRUCTIONS
  180. - Place in the model
  181. - Make sure model is anchored
  182. - That's it. It will weld the model and all children.
  183.  
  184. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  185. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  186. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  187. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  188. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  189. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  190. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  191. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  192.  
  193. 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.
  194. ]]
  195.  
  196. --[[ DOCUMENTATION
  197. - 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.
  198. - Will work in PBS servers
  199. - Will work as long as it starts out with the part anchored
  200. - Stores the relative CFrame as a CFrame value
  201. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  202. - Utilizes a recursive algorith to find all parts in the model
  203. - Will reweld on script reparent if the script is initially parented to a tool.
  204. - Welds as fast as possible
  205. ]]
  206.  
  207. -- qPerfectionWeld.lua
  208. -- Created 10/6/2014
  209. -- Author: Quenty
  210. -- Version 1.0.3
  211.  
  212. -- Updated 10/14/2014 - Updated to 1.0.1
  213. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  214.  
  215. -- Updated 10/14/2014 - Updated to 1.0.2
  216. --- Fixed bug fix.
  217.  
  218. -- Updated 10/14/2014 - Updated to 1.0.3
  219. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  220.  
  221. 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).
  222.  
  223.  
  224. local function CallOnChildren(Instance, FunctionToCall)
  225. -- Calls a function on each of the children of a certain object, using recursion.
  226.  
  227. FunctionToCall(Instance)
  228.  
  229. for _, Child in next, Instance:GetChildren() do
  230. CallOnChildren(Child, FunctionToCall)
  231. end
  232. end
  233.  
  234. local function GetNearestParent(Instance, ClassName)
  235. -- Returns the nearest parent of a certain class, or returns nil
  236.  
  237. local Ancestor = Instance
  238. repeat
  239. Ancestor = Ancestor.Parent
  240. if Ancestor == nil then
  241. return nil
  242. end
  243. until Ancestor:IsA(ClassName)
  244.  
  245. return Ancestor
  246. end
  247.  
  248. local function GetBricks(StartInstance)
  249. local List = {}
  250.  
  251. -- if StartInstance:IsA("BasePart") then
  252. -- List[#List+1] = StartInstance
  253. -- end
  254.  
  255. CallOnChildren(StartInstance, function(Item)
  256. if Item:IsA("BasePart") then
  257. List[#List+1] = Item;
  258. end
  259. end)
  260.  
  261. return List
  262. end
  263.  
  264. local function Modify(Instance, Values)
  265. -- Modifies an Instance by using a table.
  266.  
  267. assert(type(Values) == "table", "Values is not a table");
  268.  
  269. for Index, Value in next, Values do
  270. if type(Index) == "number" then
  271. Value.Parent = Instance
  272. else
  273. Instance[Index] = Value
  274. end
  275. end
  276. return Instance
  277. end
  278.  
  279. local function Make(ClassType, Properties)
  280. -- Using a syntax hack to create a nice way to Make new items.
  281.  
  282. return Modify(Instance.new(ClassType), Properties)
  283. end
  284.  
  285. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  286. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  287.  
  288. local function HasWheelJoint(Part)
  289. for _, SurfaceName in pairs(Surfaces) do
  290. for _, HingSurfaceName in pairs(HingSurfaces) do
  291. if Part[SurfaceName].Name == HingSurfaceName then
  292. return true
  293. end
  294. end
  295. end
  296.  
  297. return false
  298. end
  299.  
  300. local function ShouldBreakJoints(Part)
  301. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  302. -- definitely some edge cases.
  303.  
  304. if NEVER_BREAK_JOINTS then
  305. return false
  306. end
  307.  
  308. if HasWheelJoint(Part) then
  309. return false
  310. end
  311.  
  312. local Connected = Part:GetConnectedParts()
  313.  
  314. if #Connected == 1 then
  315. return false
  316. end
  317.  
  318. for _, Item in pairs(Connected) do
  319. if HasWheelJoint(Item) then
  320. return false
  321. elseif not Item:IsDescendantOf(script.Parent) then
  322. return false
  323. end
  324. end
  325.  
  326. return true
  327. end
  328.  
  329. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  330. --- Weld's 2 parts together
  331. -- @param Part0 The first part
  332. -- @param Part1 The second part (Dependent part most of the time).
  333. -- @param [JointType] The type of joint. Defaults to weld.
  334. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  335. -- @return The weld created.
  336.  
  337. JointType = JointType or "Weld"
  338. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  339.  
  340. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  341. Modify(NewWeld, {
  342. Name = "qCFrameWeldThingy";
  343. Part0 = Part0;
  344. Part1 = Part1;
  345. C0 = CFrame.new();--Part0.CFrame:inverse();
  346. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  347. Parent = Part1;
  348. })
  349.  
  350. if not RelativeValue then
  351. RelativeValue = Make("CFrameValue", {
  352. Parent = Part1;
  353. Name = "qRelativeCFrameWeldValue";
  354. Archivable = true;
  355. Value = NewWeld.C1;
  356. })
  357. end
  358.  
  359. return NewWeld
  360. end
  361.  
  362. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  363. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  364. -- @param MainPart The part to weld the model to (can be in the model).
  365. -- @param [JointType] The type of joint. Defaults to weld.
  366. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  367.  
  368. for _, Part in pairs(Parts) do
  369. if ShouldBreakJoints(Part) then
  370. Part:BreakJoints()
  371. end
  372. end
  373.  
  374. for _, Part in pairs(Parts) do
  375. if Part ~= MainPart then
  376. WeldTogether(MainPart, Part, JointType, MainPart)
  377. end
  378. end
  379.  
  380. if not DoNotUnanchor then
  381. for _, Part in pairs(Parts) do
  382. Part.Anchored = false
  383. end
  384. MainPart.Anchored = false
  385. end
  386. end
  387.  
  388. local function PerfectionWeld()
  389. local Tool = GetNearestParent(script, "Tool")
  390.  
  391. local Parts = GetBricks(script.Parent)
  392. 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]
  393.  
  394. if PrimaryPart then
  395. WeldParts(Parts, PrimaryPart, "Weld", false)
  396. else
  397. warn("qWeld - Unable to weld part")
  398. end
  399.  
  400. return Tool
  401. end
  402.  
  403. local Tool = PerfectionWeld()
  404.  
  405.  
  406. if Tool and script.ClassName == "Script" then
  407. --- Don't bother with local scripts
  408.  
  409. script.Parent.AncestryChanged:connect(function()
  410. PerfectionWeld()
  411. end)
  412. end
  413.  
  414. -- Created by Quenty (@Quenty, follow me on twitter).
  415.  
  416. end))
  417. Part12.Name = "Speaker"
  418. Part12.Parent = Model0
  419. Part12.CFrame = CFrame.new(-6.14870787, 0.670008898, -14.0302496, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  420. Part12.Position = Vector3.new(-6.14870787, 0.670008898, -14.0302496)
  421. Part12.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  422. Part12.Size = Vector3.new(1.00000048, 1, 0.0500000007)
  423. Part12.Anchored = true
  424. Part12.BottomSurface = Enum.SurfaceType.Smooth
  425. Part12.BrickColor = BrickColor.new("Really black")
  426. Part12.Locked = true
  427. Part12.TopSurface = Enum.SurfaceType.Smooth
  428. Part12.brickColor = BrickColor.new("Really black")
  429. Sound13.Parent = Part12
  430. Sound13.Looped = true
  431. Sound13.Playing = true
  432. Sound13.SoundId = "rbxassetid://143361760"
  433. Sound13.Volume = 10
  434. Script14.Parent = Sound13
  435. table.insert(cors,sandbox(Script14,function()
  436. script.Parent:Play()
  437. end))
  438. Model15.Name = "wheels"
  439. Model15.Parent = Model0
  440. Model16.Name = "cord1"
  441. Model16.Parent = Model15
  442. Part17.Name = "muin"
  443. Part17.Parent = Model16
  444. Part17.CFrame = CFrame.new(-7.42870522, 3.52000189, -12.8352699, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  445. Part17.Orientation = Vector3.new(0, 180, 0)
  446. Part17.Position = Vector3.new(-7.42870522, 3.52000189, -12.8352699)
  447. Part17.Rotation = Vector3.new(-180, 0, -180)
  448. Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
  449. Part17.Size = Vector3.new(1, 2, 2)
  450. Part17.BottomSurface = Enum.SurfaceType.Smooth
  451. Part17.BrickColor = BrickColor.new("Dark stone grey")
  452. Part17.Locked = true
  453. Part17.TopSurface = Enum.SurfaceType.Smooth
  454. Part17.brickColor = BrickColor.new("Dark stone grey")
  455. Part17.Shape = Enum.PartType.Cylinder
  456. HingeConstraint18.Parent = Part17
  457. HingeConstraint18.Attachment0 = nil
  458. HingeConstraint18.Attachment1 = nil
  459. HingeConstraint18.AngularVelocity = 500
  460. HingeConstraint18.ActuatorType = Enum.ActuatorType.Motor
  461. HingeConstraint18.MotorMaxTorque = 10
  462. Part19.Parent = Model16
  463. Part19.CFrame = CFrame.new(-7.95370007, 4.10500622, -12.8402596, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  464. Part19.Orientation = Vector3.new(0, 180, 0)
  465. Part19.Position = Vector3.new(-7.95370007, 4.10500622, -12.8402596)
  466. Part19.Rotation = Vector3.new(-180, 0, -180)
  467. Part19.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  468. Part19.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  469. Part19.BottomSurface = Enum.SurfaceType.Smooth
  470. Part19.BrickColor = BrickColor.new("Really black")
  471. Part19.Locked = true
  472. Part19.TopSurface = Enum.SurfaceType.Smooth
  473. Part19.brickColor = BrickColor.new("Really black")
  474. Part20.Parent = Model16
  475. Part20.CFrame = CFrame.new(-7.95370388, 3.45000386, -12.8752623, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  476. Part20.Orientation = Vector3.new(0, 180, 0)
  477. Part20.Position = Vector3.new(-7.95370388, 3.45000386, -12.8752623)
  478. Part20.Rotation = Vector3.new(-180, 0, -180)
  479. Part20.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  480. Part20.Size = Vector3.new(0.0500000007, 0.900000453, 0.760000765)
  481. Part20.BottomSurface = Enum.SurfaceType.Smooth
  482. Part20.BrickColor = BrickColor.new("Really black")
  483. Part20.Locked = true
  484. Part20.TopSurface = Enum.SurfaceType.Smooth
  485. Part20.brickColor = BrickColor.new("Really black")
  486. Part20.Shape = Enum.PartType.Cylinder
  487. Part21.Parent = Model16
  488. Part21.CFrame = CFrame.new(-7.97370052, 3.48500586, -12.2402678, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  489. Part21.Orientation = Vector3.new(-90, -180, 0)
  490. Part21.Position = Vector3.new(-7.97370052, 3.48500586, -12.2402678)
  491. Part21.Rotation = Vector3.new(-90, 0, -180)
  492. Part21.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  493. Part21.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  494. Part21.BottomSurface = Enum.SurfaceType.Smooth
  495. Part21.BrickColor = BrickColor.new("Really black")
  496. Part21.Locked = true
  497. Part21.TopSurface = Enum.SurfaceType.Smooth
  498. Part21.brickColor = BrickColor.new("Really black")
  499. Part22.Parent = Model16
  500. Part22.CFrame = CFrame.new(-7.99370098, 2.79500389, -12.8402596, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  501. Part22.Orientation = Vector3.new(0, 180, 0)
  502. Part22.Position = Vector3.new(-7.99370098, 2.79500389, -12.8402596)
  503. Part22.Rotation = Vector3.new(-180, 0, -180)
  504. Part22.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  505. Part22.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  506. Part22.BottomSurface = Enum.SurfaceType.Smooth
  507. Part22.BrickColor = BrickColor.new("Really black")
  508. Part22.Locked = true
  509. Part22.TopSurface = Enum.SurfaceType.Smooth
  510. Part22.brickColor = BrickColor.new("Really black")
  511. Part23.Parent = Model16
  512. Part23.CFrame = CFrame.new(-7.95370007, 3.48500586, -13.4802656, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  513. Part23.Orientation = Vector3.new(-90, -180, 0)
  514. Part23.Position = Vector3.new(-7.95370007, 3.48500586, -13.4802656)
  515. Part23.Rotation = Vector3.new(-90, 0, -180)
  516. Part23.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  517. Part23.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  518. Part23.BottomSurface = Enum.SurfaceType.Smooth
  519. Part23.BrickColor = BrickColor.new("Really black")
  520. Part23.Locked = true
  521. Part23.TopSurface = Enum.SurfaceType.Smooth
  522. Part23.brickColor = BrickColor.new("Really black")
  523. Script24.Name = "qPerfectionWeld"
  524. Script24.Parent = Model16
  525. table.insert(cors,sandbox(Script24,function()
  526. -- Created by Quenty (@Quenty, follow me on twitter).
  527. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  528. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  529.  
  530. --[[ INSTRUCTIONS
  531. - Place in the model
  532. - Make sure model is anchored
  533. - That's it. It will weld the model and all children.
  534.  
  535. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  536. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  537. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  538. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  539. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  540. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  541. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  542. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  543.  
  544. 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.
  545. ]]
  546.  
  547. --[[ DOCUMENTATION
  548. - 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.
  549. - Will work in PBS servers
  550. - Will work as long as it starts out with the part anchored
  551. - Stores the relative CFrame as a CFrame value
  552. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  553. - Utilizes a recursive algorith to find all parts in the model
  554. - Will reweld on script reparent if the script is initially parented to a tool.
  555. - Welds as fast as possible
  556. ]]
  557.  
  558. -- qPerfectionWeld.lua
  559. -- Created 10/6/2014
  560. -- Author: Quenty
  561. -- Version 1.0.3
  562.  
  563. -- Updated 10/14/2014 - Updated to 1.0.1
  564. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  565.  
  566. -- Updated 10/14/2014 - Updated to 1.0.2
  567. --- Fixed bug fix.
  568.  
  569. -- Updated 10/14/2014 - Updated to 1.0.3
  570. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  571.  
  572. 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).
  573.  
  574.  
  575. local function CallOnChildren(Instance, FunctionToCall)
  576. -- Calls a function on each of the children of a certain object, using recursion.
  577.  
  578. FunctionToCall(Instance)
  579.  
  580. for _, Child in next, Instance:GetChildren() do
  581. CallOnChildren(Child, FunctionToCall)
  582. end
  583. end
  584.  
  585. local function GetNearestParent(Instance, ClassName)
  586. -- Returns the nearest parent of a certain class, or returns nil
  587.  
  588. local Ancestor = Instance
  589. repeat
  590. Ancestor = Ancestor.Parent
  591. if Ancestor == nil then
  592. return nil
  593. end
  594. until Ancestor:IsA(ClassName)
  595.  
  596. return Ancestor
  597. end
  598.  
  599. local function GetBricks(StartInstance)
  600. local List = {}
  601.  
  602. -- if StartInstance:IsA("BasePart") then
  603. -- List[#List+1] = StartInstance
  604. -- end
  605.  
  606. CallOnChildren(StartInstance, function(Item)
  607. if Item:IsA("BasePart") then
  608. List[#List+1] = Item;
  609. end
  610. end)
  611.  
  612. return List
  613. end
  614.  
  615. local function Modify(Instance, Values)
  616. -- Modifies an Instance by using a table.
  617.  
  618. assert(type(Values) == "table", "Values is not a table");
  619.  
  620. for Index, Value in next, Values do
  621. if type(Index) == "number" then
  622. Value.Parent = Instance
  623. else
  624. Instance[Index] = Value
  625. end
  626. end
  627. return Instance
  628. end
  629.  
  630. local function Make(ClassType, Properties)
  631. -- Using a syntax hack to create a nice way to Make new items.
  632.  
  633. return Modify(Instance.new(ClassType), Properties)
  634. end
  635.  
  636. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  637. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  638.  
  639. local function HasWheelJoint(Part)
  640. for _, SurfaceName in pairs(Surfaces) do
  641. for _, HingSurfaceName in pairs(HingSurfaces) do
  642. if Part[SurfaceName].Name == HingSurfaceName then
  643. return true
  644. end
  645. end
  646. end
  647.  
  648. return false
  649. end
  650.  
  651. local function ShouldBreakJoints(Part)
  652. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  653. -- definitely some edge cases.
  654.  
  655. if NEVER_BREAK_JOINTS then
  656. return false
  657. end
  658.  
  659. if HasWheelJoint(Part) then
  660. return false
  661. end
  662.  
  663. local Connected = Part:GetConnectedParts()
  664.  
  665. if #Connected == 1 then
  666. return false
  667. end
  668.  
  669. for _, Item in pairs(Connected) do
  670. if HasWheelJoint(Item) then
  671. return false
  672. elseif not Item:IsDescendantOf(script.Parent) then
  673. return false
  674. end
  675. end
  676.  
  677. return true
  678. end
  679.  
  680. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  681. --- Weld's 2 parts together
  682. -- @param Part0 The first part
  683. -- @param Part1 The second part (Dependent part most of the time).
  684. -- @param [JointType] The type of joint. Defaults to weld.
  685. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  686. -- @return The weld created.
  687.  
  688. JointType = JointType or "Weld"
  689. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  690.  
  691. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  692. Modify(NewWeld, {
  693. Name = "qCFrameWeldThingy";
  694. Part0 = Part0;
  695. Part1 = Part1;
  696. C0 = CFrame.new();--Part0.CFrame:inverse();
  697. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  698. Parent = Part1;
  699. })
  700.  
  701. if not RelativeValue then
  702. RelativeValue = Make("CFrameValue", {
  703. Parent = Part1;
  704. Name = "qRelativeCFrameWeldValue";
  705. Archivable = true;
  706. Value = NewWeld.C1;
  707. })
  708. end
  709.  
  710. return NewWeld
  711. end
  712.  
  713. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  714. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  715. -- @param MainPart The part to weld the model to (can be in the model).
  716. -- @param [JointType] The type of joint. Defaults to weld.
  717. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  718.  
  719. for _, Part in pairs(Parts) do
  720. if ShouldBreakJoints(Part) then
  721. Part:BreakJoints()
  722. end
  723. end
  724.  
  725. for _, Part in pairs(Parts) do
  726. if Part ~= MainPart then
  727. WeldTogether(MainPart, Part, JointType, MainPart)
  728. end
  729. end
  730.  
  731. if not DoNotUnanchor then
  732. for _, Part in pairs(Parts) do
  733. Part.Anchored = false
  734. end
  735. MainPart.Anchored = false
  736. end
  737. end
  738.  
  739. local function PerfectionWeld()
  740. local Tool = GetNearestParent(script, "Tool")
  741.  
  742. local Parts = GetBricks(script.Parent)
  743. 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]
  744.  
  745. if PrimaryPart then
  746. WeldParts(Parts, PrimaryPart, "Weld", false)
  747. else
  748. warn("qWeld - Unable to weld part")
  749. end
  750.  
  751. return Tool
  752. end
  753.  
  754. local Tool = PerfectionWeld()
  755.  
  756.  
  757. if Tool and script.ClassName == "Script" then
  758. --- Don't bother with local scripts
  759.  
  760. script.Parent.AncestryChanged:connect(function()
  761. PerfectionWeld()
  762. end)
  763. end
  764.  
  765. -- Created by Quenty (@Quenty, follow me on twitter).
  766.  
  767. end))
  768. Model25.Name = "cord2"
  769. Model25.Parent = Model15
  770. Part26.Parent = Model25
  771. Part26.CFrame = CFrame.new(-7.96370792, 4.05500793, -10.7902298, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  772. Part26.Orientation = Vector3.new(0, 180, 0)
  773. Part26.Position = Vector3.new(-7.96370792, 4.05500793, -10.7902298)
  774. Part26.Rotation = Vector3.new(-180, 0, -180)
  775. Part26.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  776. Part26.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  777. Part26.BottomSurface = Enum.SurfaceType.Smooth
  778. Part26.BrickColor = BrickColor.new("Really black")
  779. Part26.Locked = true
  780. Part26.TopSurface = Enum.SurfaceType.Smooth
  781. Part26.brickColor = BrickColor.new("Really black")
  782. Part27.Parent = Model25
  783. Part27.CFrame = CFrame.new(-7.93370676, 3.43500948, -11.4302359, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  784. Part27.Orientation = Vector3.new(-90, -180, 0)
  785. Part27.Position = Vector3.new(-7.93370676, 3.43500948, -11.4302359)
  786. Part27.Rotation = Vector3.new(-90, 0, -180)
  787. Part27.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  788. Part27.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  789. Part27.BottomSurface = Enum.SurfaceType.Smooth
  790. Part27.BrickColor = BrickColor.new("Really black")
  791. Part27.Locked = true
  792. Part27.TopSurface = Enum.SurfaceType.Smooth
  793. Part27.brickColor = BrickColor.new("Really black")
  794. Part28.Parent = Model25
  795. Part28.CFrame = CFrame.new(-7.94370604, 3.40001035, -10.8252335, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  796. Part28.Orientation = Vector3.new(0, 180, 0)
  797. Part28.Position = Vector3.new(-7.94370604, 3.40001035, -10.8252335)
  798. Part28.Rotation = Vector3.new(-180, 0, -180)
  799. Part28.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  800. Part28.Size = Vector3.new(0.0500000007, 0.900000453, 0.760000765)
  801. Part28.BottomSurface = Enum.SurfaceType.Smooth
  802. Part28.BrickColor = BrickColor.new("Really black")
  803. Part28.Locked = true
  804. Part28.TopSurface = Enum.SurfaceType.Smooth
  805. Part28.brickColor = BrickColor.new("Really black")
  806. Part28.Shape = Enum.PartType.Cylinder
  807. Part29.Parent = Model25
  808. Part29.CFrame = CFrame.new(-7.91370773, 3.43500948, -10.190238, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  809. Part29.Orientation = Vector3.new(-90, -180, 0)
  810. Part29.Position = Vector3.new(-7.91370773, 3.43500948, -10.190238)
  811. Part29.Rotation = Vector3.new(-90, 0, -180)
  812. Part29.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  813. Part29.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  814. Part29.BottomSurface = Enum.SurfaceType.Smooth
  815. Part29.BrickColor = BrickColor.new("Really black")
  816. Part29.Locked = true
  817. Part29.TopSurface = Enum.SurfaceType.Smooth
  818. Part29.brickColor = BrickColor.new("Really black")
  819. Part30.Parent = Model25
  820. Part30.CFrame = CFrame.new(-7.92370749, 2.74500847, -10.7902298, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  821. Part30.Orientation = Vector3.new(0, 180, 0)
  822. Part30.Position = Vector3.new(-7.92370749, 2.74500847, -10.7902298)
  823. Part30.Rotation = Vector3.new(-180, 0, -180)
  824. Part30.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  825. Part30.Size = Vector3.new(0.0500000007, 0.49000001, 0.330000371)
  826. Part30.BottomSurface = Enum.SurfaceType.Smooth
  827. Part30.BrickColor = BrickColor.new("Really black")
  828. Part30.Locked = true
  829. Part30.TopSurface = Enum.SurfaceType.Smooth
  830. Part30.brickColor = BrickColor.new("Really black")
  831. Part31.Name = "muin"
  832. Part31.Parent = Model25
  833. Part31.CFrame = CFrame.new(-7.41871119, 3.47000837, -10.7852402, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  834. Part31.Orientation = Vector3.new(0, 180, 0)
  835. Part31.Position = Vector3.new(-7.41871119, 3.47000837, -10.7852402)
  836. Part31.Rotation = Vector3.new(-180, 0, -180)
  837. Part31.Color = Color3.new(0.388235, 0.372549, 0.384314)
  838. Part31.Size = Vector3.new(1, 2, 2)
  839. Part31.BottomSurface = Enum.SurfaceType.Smooth
  840. Part31.BrickColor = BrickColor.new("Dark stone grey")
  841. Part31.Locked = true
  842. Part31.TopSurface = Enum.SurfaceType.Smooth
  843. Part31.brickColor = BrickColor.new("Dark stone grey")
  844. Part31.Shape = Enum.PartType.Cylinder
  845. HingeConstraint32.Parent = Part31
  846. HingeConstraint32.Attachment0 = nil
  847. HingeConstraint32.Attachment1 = nil
  848. HingeConstraint32.AngularVelocity = 500
  849. HingeConstraint32.ActuatorType = Enum.ActuatorType.Motor
  850. HingeConstraint32.MotorMaxTorque = 10
  851. Script33.Name = "qPerfectionWeld"
  852. Script33.Parent = Model25
  853. table.insert(cors,sandbox(Script33,function()
  854. -- Created by Quenty (@Quenty, follow me on twitter).
  855. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  856. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  857.  
  858. --[[ INSTRUCTIONS
  859. - Place in the model
  860. - Make sure model is anchored
  861. - That's it. It will weld the model and all children.
  862.  
  863. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  864. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  865. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  866. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  867. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  868. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  869. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  870. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  871.  
  872. 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.
  873. ]]
  874.  
  875. --[[ DOCUMENTATION
  876. - 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.
  877. - Will work in PBS servers
  878. - Will work as long as it starts out with the part anchored
  879. - Stores the relative CFrame as a CFrame value
  880. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  881. - Utilizes a recursive algorith to find all parts in the model
  882. - Will reweld on script reparent if the script is initially parented to a tool.
  883. - Welds as fast as possible
  884. ]]
  885.  
  886. -- qPerfectionWeld.lua
  887. -- Created 10/6/2014
  888. -- Author: Quenty
  889. -- Version 1.0.3
  890.  
  891. -- Updated 10/14/2014 - Updated to 1.0.1
  892. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  893.  
  894. -- Updated 10/14/2014 - Updated to 1.0.2
  895. --- Fixed bug fix.
  896.  
  897. -- Updated 10/14/2014 - Updated to 1.0.3
  898. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  899.  
  900. 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).
  901.  
  902.  
  903. local function CallOnChildren(Instance, FunctionToCall)
  904. -- Calls a function on each of the children of a certain object, using recursion.
  905.  
  906. FunctionToCall(Instance)
  907.  
  908. for _, Child in next, Instance:GetChildren() do
  909. CallOnChildren(Child, FunctionToCall)
  910. end
  911. end
  912.  
  913. local function GetNearestParent(Instance, ClassName)
  914. -- Returns the nearest parent of a certain class, or returns nil
  915.  
  916. local Ancestor = Instance
  917. repeat
  918. Ancestor = Ancestor.Parent
  919. if Ancestor == nil then
  920. return nil
  921. end
  922. until Ancestor:IsA(ClassName)
  923.  
  924. return Ancestor
  925. end
  926.  
  927. local function GetBricks(StartInstance)
  928. local List = {}
  929.  
  930. -- if StartInstance:IsA("BasePart") then
  931. -- List[#List+1] = StartInstance
  932. -- end
  933.  
  934. CallOnChildren(StartInstance, function(Item)
  935. if Item:IsA("BasePart") then
  936. List[#List+1] = Item;
  937. end
  938. end)
  939.  
  940. return List
  941. end
  942.  
  943. local function Modify(Instance, Values)
  944. -- Modifies an Instance by using a table.
  945.  
  946. assert(type(Values) == "table", "Values is not a table");
  947.  
  948. for Index, Value in next, Values do
  949. if type(Index) == "number" then
  950. Value.Parent = Instance
  951. else
  952. Instance[Index] = Value
  953. end
  954. end
  955. return Instance
  956. end
  957.  
  958. local function Make(ClassType, Properties)
  959. -- Using a syntax hack to create a nice way to Make new items.
  960.  
  961. return Modify(Instance.new(ClassType), Properties)
  962. end
  963.  
  964. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  965. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  966.  
  967. local function HasWheelJoint(Part)
  968. for _, SurfaceName in pairs(Surfaces) do
  969. for _, HingSurfaceName in pairs(HingSurfaces) do
  970. if Part[SurfaceName].Name == HingSurfaceName then
  971. return true
  972. end
  973. end
  974. end
  975.  
  976. return false
  977. end
  978.  
  979. local function ShouldBreakJoints(Part)
  980. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  981. -- definitely some edge cases.
  982.  
  983. if NEVER_BREAK_JOINTS then
  984. return false
  985. end
  986.  
  987. if HasWheelJoint(Part) then
  988. return false
  989. end
  990.  
  991. local Connected = Part:GetConnectedParts()
  992.  
  993. if #Connected == 1 then
  994. return false
  995. end
  996.  
  997. for _, Item in pairs(Connected) do
  998. if HasWheelJoint(Item) then
  999. return false
  1000. elseif not Item:IsDescendantOf(script.Parent) then
  1001. return false
  1002. end
  1003. end
  1004.  
  1005. return true
  1006. end
  1007.  
  1008. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1009. --- Weld's 2 parts together
  1010. -- @param Part0 The first part
  1011. -- @param Part1 The second part (Dependent part most of the time).
  1012. -- @param [JointType] The type of joint. Defaults to weld.
  1013. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1014. -- @return The weld created.
  1015.  
  1016. JointType = JointType or "Weld"
  1017. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1018.  
  1019. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1020. Modify(NewWeld, {
  1021. Name = "qCFrameWeldThingy";
  1022. Part0 = Part0;
  1023. Part1 = Part1;
  1024. C0 = CFrame.new();--Part0.CFrame:inverse();
  1025. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1026. Parent = Part1;
  1027. })
  1028.  
  1029. if not RelativeValue then
  1030. RelativeValue = Make("CFrameValue", {
  1031. Parent = Part1;
  1032. Name = "qRelativeCFrameWeldValue";
  1033. Archivable = true;
  1034. Value = NewWeld.C1;
  1035. })
  1036. end
  1037.  
  1038. return NewWeld
  1039. end
  1040.  
  1041. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1042. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1043. -- @param MainPart The part to weld the model to (can be in the model).
  1044. -- @param [JointType] The type of joint. Defaults to weld.
  1045. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1046.  
  1047. for _, Part in pairs(Parts) do
  1048. if ShouldBreakJoints(Part) then
  1049. Part:BreakJoints()
  1050. end
  1051. end
  1052.  
  1053. for _, Part in pairs(Parts) do
  1054. if Part ~= MainPart then
  1055. WeldTogether(MainPart, Part, JointType, MainPart)
  1056. end
  1057. end
  1058.  
  1059. if not DoNotUnanchor then
  1060. for _, Part in pairs(Parts) do
  1061. Part.Anchored = false
  1062. end
  1063. MainPart.Anchored = false
  1064. end
  1065. end
  1066.  
  1067. local function PerfectionWeld()
  1068. local Tool = GetNearestParent(script, "Tool")
  1069.  
  1070. local Parts = GetBricks(script.Parent)
  1071. 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]
  1072.  
  1073. if PrimaryPart then
  1074. WeldParts(Parts, PrimaryPart, "Weld", false)
  1075. else
  1076. warn("qWeld - Unable to weld part")
  1077. end
  1078.  
  1079. return Tool
  1080. end
  1081.  
  1082. local Tool = PerfectionWeld()
  1083.  
  1084.  
  1085. if Tool and script.ClassName == "Script" then
  1086. --- Don't bother with local scripts
  1087.  
  1088. script.Parent.AncestryChanged:connect(function()
  1089. PerfectionWeld()
  1090. end)
  1091. end
  1092.  
  1093. -- Created by Quenty (@Quenty, follow me on twitter).
  1094.  
  1095. end))
  1096. Script34.Parent = Model0
  1097. table.insert(cors,sandbox(Script34,function()
  1098. local chara = owner.Character
  1099. script.Parent.Parent = chara
  1100.  
  1101. end))
  1102. for i,v in pairs(mas:GetChildren()) do
  1103. v.Parent = workspace
  1104. pcall(function() v:MakeJoints() end)
  1105. end
  1106. mas:Destroy()
  1107. for i,v in pairs(cors) do
  1108. spawn(function()
  1109. pcall(v)
  1110. end)
  1111. end
Advertisement
Add Comment
Please, Sign In to add comment