Advertisement
Gamerulexerul

Untitled

Mar 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 124.53 KB | None | 0 0
  1.  
  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. Attachment1 = Instance.new("Attachment")
  21. Vector3Value2 = Instance.new("Vector3Value")
  22. Script3 = Instance.new("Script")
  23. Script4 = Instance.new("Script")
  24. Script5 = Instance.new("Script")
  25. Sound6 = Instance.new("Sound")
  26. Script7 = Instance.new("Script")
  27. Motor6D8 = Instance.new("Motor6D")
  28. Attachment9 = Instance.new("Attachment")
  29. Attachment10 = Instance.new("Attachment")
  30. Vector3Value11 = Instance.new("Vector3Value")
  31. Script12 = Instance.new("Script")
  32. Script13 = Instance.new("Script")
  33. Script14 = Instance.new("Script")
  34. Part15 = Instance.new("Part")
  35. SpecialMesh16 = Instance.new("SpecialMesh")
  36. Part17 = Instance.new("Part")
  37. Script18 = Instance.new("Script")
  38. Script19 = Instance.new("Script")
  39. Sound20 = Instance.new("Sound")
  40. Sound21 = Instance.new("Sound")
  41. Motor6D22 = Instance.new("Motor6D")
  42. Attachment23 = Instance.new("Attachment")
  43. Attachment24 = Instance.new("Attachment")
  44. Vector3Value25 = Instance.new("Vector3Value")
  45. Script26 = Instance.new("Script")
  46. Script27 = Instance.new("Script")
  47. Motor6D28 = Instance.new("Motor6D")
  48. Attachment29 = Instance.new("Attachment")
  49. Attachment30 = Instance.new("Attachment")
  50. Vector3Value31 = Instance.new("Vector3Value")
  51. Motor6D32 = Instance.new("Motor6D")
  52. Attachment33 = Instance.new("Attachment")
  53. Attachment34 = Instance.new("Attachment")
  54. Attachment35 = Instance.new("Attachment")
  55. Vector3Value36 = Instance.new("Vector3Value")
  56. Motor6D37 = Instance.new("Motor6D")
  57. Attachment38 = Instance.new("Attachment")
  58. Attachment39 = Instance.new("Attachment")
  59. Vector3Value40 = Instance.new("Vector3Value")
  60. Motor6D41 = Instance.new("Motor6D")
  61. Attachment42 = Instance.new("Attachment")
  62. Attachment43 = Instance.new("Attachment")
  63. Attachment44 = Instance.new("Attachment")
  64. Attachment45 = Instance.new("Attachment")
  65. Attachment46 = Instance.new("Attachment")
  66. Attachment47 = Instance.new("Attachment")
  67. Attachment48 = Instance.new("Attachment")
  68. Vector3Value49 = Instance.new("Vector3Value")
  69. Script50 = Instance.new("Script")
  70. Script51 = Instance.new("Script")
  71. Motor6D52 = Instance.new("Motor6D")
  72. Script53 = Instance.new("Script")
  73. Attachment54 = Instance.new("Attachment")
  74. Vector3Value55 = Instance.new("Vector3Value")
  75. Script56 = Instance.new("Script")
  76. Script57 = Instance.new("Script")
  77. Script58 = Instance.new("Script")
  78. Script59 = Instance.new("Script")
  79. Sound60 = Instance.new("Sound")
  80. Motor6D61 = Instance.new("Motor6D")
  81. Attachment62 = Instance.new("Attachment")
  82. Attachment63 = Instance.new("Attachment")
  83. Vector3Value64 = Instance.new("Vector3Value")
  84. Script65 = Instance.new("Script")
  85. Script66 = Instance.new("Script")
  86. Script67 = Instance.new("Script")
  87. Part68 = Instance.new("Part")
  88. SpecialMesh69 = Instance.new("SpecialMesh")
  89. Part70 = Instance.new("Part")
  90. Script71 = Instance.new("Script")
  91. Script72 = Instance.new("Script")
  92. Sound73 = Instance.new("Sound")
  93. Sound74 = Instance.new("Sound")
  94. Motor6D75 = Instance.new("Motor6D")
  95. Attachment76 = Instance.new("Attachment")
  96. Attachment77 = Instance.new("Attachment")
  97. Vector3Value78 = Instance.new("Vector3Value")
  98. Script79 = Instance.new("Script")
  99. Script80 = Instance.new("Script")
  100. Motor6D81 = Instance.new("Motor6D")
  101. Attachment82 = Instance.new("Attachment")
  102. Attachment83 = Instance.new("Attachment")
  103. Vector3Value84 = Instance.new("Vector3Value")
  104. Motor6D85 = Instance.new("Motor6D")
  105. Attachment86 = Instance.new("Attachment")
  106. Attachment87 = Instance.new("Attachment")
  107. Attachment88 = Instance.new("Attachment")
  108. Vector3Value89 = Instance.new("Vector3Value")
  109. Motor6D90 = Instance.new("Motor6D")
  110. Attachment91 = Instance.new("Attachment")
  111. Attachment92 = Instance.new("Attachment")
  112. Vector3Value93 = Instance.new("Vector3Value")
  113. Motor6D94 = Instance.new("Motor6D")
  114. IntValue95 = Instance.new("IntValue")
  115. Humanoid96 = Instance.new("Humanoid")
  116. Attachment97 = Instance.new("Attachment")
  117. Attachment98 = Instance.new("Attachment")
  118. Attachment99 = Instance.new("Attachment")
  119. Attachment100 = Instance.new("Attachment")
  120. Attachment101 = Instance.new("Attachment")
  121. Attachment102 = Instance.new("Attachment")
  122. Attachment103 = Instance.new("Attachment")
  123. Attachment104 = Instance.new("Attachment")
  124. Vector3Value105 = Instance.new("Vector3Value")
  125. Script106 = Instance.new("Script")
  126. Script107 = Instance.new("Script")
  127. Script108 = Instance.new("Script")
  128. Motor6D109 = Instance.new("Motor6D")
  129. Script110 = Instance.new("Script")
  130. Part111 = Instance.new("Part")
  131. Attachment112 = Instance.new("Attachment")
  132. Vector3Value113 = Instance.new("Vector3Value")
  133. Script114 = Instance.new("Script")
  134. Script115 = Instance.new("Script")
  135. Part116 = Instance.new("Part")
  136. Script117 = Instance.new("Script")
  137. ScreenGui118 = Instance.new("ScreenGui")
  138. Frame119 = Instance.new("Frame")
  139. ImageLabel120 = Instance.new("ImageLabel")
  140. Sound121 = Instance.new("Sound")
  141. Script122 = Instance.new("Script")
  142. Part123 = Instance.new("Part")
  143. Attachment124 = Instance.new("Attachment")
  144. Attachment125 = Instance.new("Attachment")
  145. Attachment126 = Instance.new("Attachment")
  146. Attachment127 = Instance.new("Attachment")
  147. Attachment128 = Instance.new("Attachment")
  148. Attachment129 = Instance.new("Attachment")
  149. Vector3Value130 = Instance.new("Vector3Value")
  150. Script131 = Instance.new("Script")
  151. Script132 = Instance.new("Script")
  152. Motor6D133 = Instance.new("Motor6D")
  153. Sound134 = Instance.new("Sound")
  154. Sound135 = Instance.new("Sound")
  155. SpecialMesh136 = Instance.new("SpecialMesh")
  156. Script137 = Instance.new("Script")
  157. Script138 = Instance.new("Script")
  158. Script139 = Instance.new("Script")
  159. StringValue140 = Instance.new("StringValue")
  160. Animation141 = Instance.new("Animation")
  161. StringValue142 = Instance.new("StringValue")
  162. Animation143 = Instance.new("Animation")
  163. StringValue144 = Instance.new("StringValue")
  164. Animation145 = Instance.new("Animation")
  165. NumberValue146 = Instance.new("NumberValue")
  166. Animation147 = Instance.new("Animation")
  167. NumberValue148 = Instance.new("NumberValue")
  168. Animation149 = Instance.new("Animation")
  169. NumberValue150 = Instance.new("NumberValue")
  170. StringValue151 = Instance.new("StringValue")
  171. Animation152 = Instance.new("Animation")
  172. StringValue153 = Instance.new("StringValue")
  173. Animation154 = Instance.new("Animation")
  174. StringValue155 = Instance.new("StringValue")
  175. Animation156 = Instance.new("Animation")
  176. StringValue157 = Instance.new("StringValue")
  177. Animation158 = Instance.new("Animation")
  178. Script159 = Instance.new("Script")
  179. Script160 = Instance.new("Script")
  180. Script161 = Instance.new("Script")
  181. LocalScript162 = Instance.new("LocalScript")
  182. Script163 = Instance.new("Script")
  183. ObjectValue164 = Instance.new("ObjectValue")
  184. Pants165 = Instance.new("Pants")
  185. Shirt166 = Instance.new("Shirt")
  186. Script167 = Instance.new("Script")
  187. Sound168 = Instance.new("Sound")
  188. Model0.Name = " "
  189. Model0.Parent = Model0
  190. Attachment1.Name = "LeftAnkleRigAttachment"
  191. Attachment1.Parent = mas
  192. Attachment1.CFrame = CFrame.new(-0.061065957, 0.219720781, 0.00120258261, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  193. Attachment1.Position = Vector3.new(-0.061065957, 0.219720781, 0.00120258261)
  194. Vector3Value2.Name = "OriginalSize"
  195. Vector3Value2.Parent = mas
  196. Vector3Value2.Value = Vector3.new(1.00063133, 0.335407257, 1.00020337)
  197. Script3.Name = "ShieldScript"
  198. Script3.Parent = mas
  199. table.insert(cors,sandbox(Script3,function()
  200. function ot(hit)
  201. ch = hit:GetChildren()
  202. for i = 1, #ch do
  203. if ch[i].className == "BodyVelocity" then
  204. ch[i].velocity = ch[i].velocity*-1
  205. end
  206. end
  207. if hit.Parent ~= nil then
  208. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  209. if hit.Parent ~= script.Parent.Parent then
  210. if hit.Parent:FindFirstChild("Torso") ~= nil then
  211. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  212. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  213. end
  214. hit.Parent.Humanoid.PlatformStand = true
  215. end
  216. else
  217. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  218. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  219. hit:breakJoints()
  220. if hit.Anchored == false then
  221. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  222. end
  223. end
  224. else
  225. hit:breakJoints()
  226. if hit.Anchored == false then
  227. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  228. end
  229. end
  230. end
  231. end
  232. if hit.Parent ~= nil then
  233. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  234. if hit.Parent ~= script.Parent.Parent then
  235. wait(0.5)
  236. hit.Parent.Humanoid.PlatformStand = false
  237. end
  238. end
  239. end
  240. end
  241. function remove(child)
  242. child:Remove()
  243. end
  244. script.Parent.Touched:connect(ot)
  245. script.Parent.ChildAdded:connect(remove)
  246. end))
  247. Script4.Name = "Hurting"
  248. Script4.Parent = mas
  249. table.insert(cors,sandbox(Script4,function()
  250. function onTouched(hit)
  251. local humanoid = hit.Parent:findFirstChild("Humanoid")
  252. if (humanoid ~= nil) then
  253. humanoid.Health = humanoid.Health - 25
  254. end
  255. end
  256.  
  257. script.Parent.Touched:connect(onTouched)
  258. end))
  259. Script5.Parent = mas
  260. table.insert(cors,sandbox(Script5,function()
  261. function onTouched(hit)
  262. script.Parent.Sound:play()
  263. end
  264. script.Parent.Touched:connect(onTouched)
  265. end))
  266. Sound6.Parent = mas
  267. Sound6.Pitch = 1.3999999761581
  268. Sound6.SoundId = "rbxassetid://198360408"
  269. Sound6.Volume = 4
  270. Script7.Name = "qPerfectionWeld"
  271. Script7.Parent = mas
  272. table.insert(cors,sandbox(Script7,function()
  273. -- Created by Quenty (@Quenty, follow me on twitter).
  274. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  275. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  276.  
  277. --[[ INSTRUCTIONS
  278. - Place in the model
  279. - Make sure model is anchored
  280. - That's it. It will weld the model and all children.
  281.  
  282. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  283. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  284. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  285. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  286. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  287. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  288. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  289. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  290.  
  291. 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.
  292. ]]
  293.  
  294. --[[ DOCUMENTATION
  295. - 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.
  296. - Will work in PBS servers
  297. - Will work as long as it starts out with the part anchored
  298. - Stores the relative CFrame as a CFrame value
  299. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  300. - Utilizes a recursive algorith to find all parts in the model
  301. - Will reweld on script reparent if the script is initially parented to a tool.
  302. - Welds as fast as possible
  303. ]]
  304.  
  305. -- qPerfectionWeld.lua
  306. -- Created 10/6/2014
  307. -- Author: Quenty
  308. -- Version 1.0.3
  309.  
  310. -- Updated 10/14/2014 - Updated to 1.0.1
  311. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  312.  
  313. -- Updated 10/14/2014 - Updated to 1.0.2
  314. --- Fixed bug fix.
  315.  
  316. -- Updated 10/14/2014 - Updated to 1.0.3
  317. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  318.  
  319. 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).
  320.  
  321.  
  322. local function CallOnChildren(Instance, FunctionToCall)
  323. -- Calls a function on each of the children of a certain object, using recursion.
  324.  
  325. FunctionToCall(Instance)
  326.  
  327. for _, Child in next, Instance:GetChildren() do
  328. CallOnChildren(Child, FunctionToCall)
  329. end
  330. end
  331.  
  332. local function GetNearestParent(Instance, ClassName)
  333. -- Returns the nearest parent of a certain class, or returns nil
  334.  
  335. local Ancestor = Instance
  336. repeat
  337. Ancestor = Ancestor.Parent
  338. if Ancestor == nil then
  339. return nil
  340. end
  341. until Ancestor:IsA(ClassName)
  342.  
  343. return Ancestor
  344. end
  345.  
  346. local function GetBricks(StartInstance)
  347. local List = {}
  348.  
  349. -- if StartInstance:IsA("BasePart") then
  350. -- List[#List+1] = StartInstance
  351. -- end
  352.  
  353. CallOnChildren(StartInstance, function(Item)
  354. if Item:IsA("BasePart") then
  355. List[#List+1] = Item;
  356. end
  357. end)
  358.  
  359. return List
  360. end
  361.  
  362. local function Modify(Instance, Values)
  363. -- Modifies an Instance by using a table.
  364.  
  365. assert(type(Values) == "table", "Values is not a table");
  366.  
  367. for Index, Value in next, Values do
  368. if type(Index) == "number" then
  369. Value.Parent = Instance
  370. else
  371. Instance[Index] = Value
  372. end
  373. end
  374. return Instance
  375. end
  376.  
  377. local function Make(ClassType, Properties)
  378. -- Using a syntax hack to create a nice way to Make new items.
  379.  
  380. return Modify(Instance.new(ClassType), Properties)
  381. end
  382.  
  383. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  384. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  385.  
  386. local function HasWheelJoint(Part)
  387. for _, SurfaceName in pairs(Surfaces) do
  388. for _, HingSurfaceName in pairs(HingSurfaces) do
  389. if Part[SurfaceName].Name == HingSurfaceName then
  390. return true
  391. end
  392. end
  393. end
  394.  
  395. return false
  396. end
  397.  
  398. local function ShouldBreakJoints(Part)
  399. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  400. -- definitely some edge cases.
  401.  
  402. if NEVER_BREAK_JOINTS then
  403. return false
  404. end
  405.  
  406. if HasWheelJoint(Part) then
  407. return false
  408. end
  409.  
  410. local Connected = Part:GetConnectedParts()
  411.  
  412. if #Connected == 1 then
  413. return false
  414. end
  415.  
  416. for _, Item in pairs(Connected) do
  417. if HasWheelJoint(Item) then
  418. return false
  419. elseif not Item:IsDescendantOf(script.Parent) then
  420. return false
  421. end
  422. end
  423.  
  424. return true
  425. end
  426.  
  427. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  428. --- Weld's 2 parts together
  429. -- @param Part0 The first part
  430. -- @param Part1 The second part (Dependent part most of the time).
  431. -- @param [JointType] The type of joint. Defaults to weld.
  432. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  433. -- @return The weld created.
  434.  
  435. JointType = JointType or "Weld"
  436. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  437.  
  438. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  439. Modify(NewWeld, {
  440. Name = "qCFrameWeldThingy";
  441. Part0 = Part0;
  442. Part1 = Part1;
  443. C0 = CFrame.new();--Part0.CFrame:inverse();
  444. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  445. Parent = Part1;
  446. })
  447.  
  448. if not RelativeValue then
  449. RelativeValue = Make("CFrameValue", {
  450. Parent = Part1;
  451. Name = "qRelativeCFrameWeldValue";
  452. Archivable = true;
  453. Value = NewWeld.C1;
  454. })
  455. end
  456.  
  457. return NewWeld
  458. end
  459.  
  460. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  461. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  462. -- @param MainPart The part to weld the model to (can be in the model).
  463. -- @param [JointType] The type of joint. Defaults to weld.
  464. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  465.  
  466. for _, Part in pairs(Parts) do
  467. if ShouldBreakJoints(Part) then
  468. Part:BreakJoints()
  469. end
  470. end
  471.  
  472. for _, Part in pairs(Parts) do
  473. if Part ~= MainPart then
  474. WeldTogether(MainPart, Part, JointType, MainPart)
  475. end
  476. end
  477.  
  478. if not DoNotUnanchor then
  479. for _, Part in pairs(Parts) do
  480. Part.Anchored = false
  481. end
  482. MainPart.Anchored = false
  483. end
  484. end
  485.  
  486. local function PerfectionWeld()
  487. local Tool = GetNearestParent(script, "Tool")
  488.  
  489. local Parts = GetBricks(script.Parent)
  490. 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]
  491.  
  492. if PrimaryPart then
  493. WeldParts(Parts, PrimaryPart, "Weld", false)
  494. else
  495. warn("qWeld - Unable to weld part")
  496. end
  497.  
  498. return Tool
  499. end
  500.  
  501. local Tool = PerfectionWeld()
  502.  
  503.  
  504. if Tool and script.ClassName == "Script" then
  505. --- Don't bother with local scripts
  506.  
  507. script.Parent.AncestryChanged:connect(function()
  508. PerfectionWeld()
  509. end)
  510. end
  511.  
  512. -- Created by Quenty (@Quenty, follow me on twitter).
  513.  
  514. end))
  515. Motor6D8.Name = "LeftAnkle"
  516. Motor6D8.Parent = mas
  517. Motor6D8.C0 = CFrame.new(-0.0259127952, -4.80933714, 0.00206926349, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  518. Motor6D8.C1 = CFrame.new(-0.0610660091, 0.21972087, 0.00120258378, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  519. Motor6D8.Part0 = nil
  520. Motor6D8.Part1 = nil
  521. Attachment9.Name = "LeftWristRigAttachment"
  522. Attachment9.Parent = mas
  523. Attachment9.CFrame = CFrame.new(-0.0026157801, 0.392130703, -0.10456007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  524. Attachment9.Position = Vector3.new(-0.0026157801, 0.392130703, -0.10456007)
  525. Attachment10.Name = "LeftGripAttachment"
  526. Attachment10.Parent = mas
  527. Attachment10.Rotation = Vector3.new(-90, -0, -0)
  528. Attachment10.CFrame = CFrame.new(-0.0731796622, -1.1422714, -0.104559548, 1, 0, -0, 0, 6.12323426e-17, 1, 0, -1, 6.12323426e-17)
  529. Attachment10.Position = Vector3.new(-0.0731796622, -1.1422714, -0.104559548)
  530. Attachment10.Orientation = Vector3.new(-90, -0, 0)
  531. Vector3Value11.Name = "OriginalSize"
  532. Vector3Value11.Parent = mas
  533. Vector3Value11.Value = Vector3.new(0.999299049, 0.335255831, 1.00029743)
  534. Script12.Name = "ShieldScript"
  535. Script12.Parent = mas
  536. table.insert(cors,sandbox(Script12,function()
  537. function ot(hit)
  538. ch = hit:GetChildren()
  539. for i = 1, #ch do
  540. if ch[i].className == "BodyVelocity" then
  541. ch[i].velocity = ch[i].velocity*-1
  542. end
  543. end
  544. if hit.Parent ~= nil then
  545. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  546. if hit.Parent ~= script.Parent.Parent then
  547. if hit.Parent:FindFirstChild("Torso") ~= nil then
  548. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  549. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  550. end
  551. hit.Parent.Humanoid.PlatformStand = true
  552. end
  553. else
  554. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  555. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  556. hit:breakJoints()
  557. if hit.Anchored == false then
  558. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  559. end
  560. end
  561. else
  562. hit:breakJoints()
  563. if hit.Anchored == false then
  564. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  565. end
  566. end
  567. end
  568. end
  569. if hit.Parent ~= nil then
  570. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  571. if hit.Parent ~= script.Parent.Parent then
  572. wait(0.5)
  573. hit.Parent.Humanoid.PlatformStand = false
  574. end
  575. end
  576. end
  577. end
  578. function remove(child)
  579. child:Remove()
  580. end
  581. script.Parent.Touched:connect(ot)
  582. script.Parent.ChildAdded:connect(remove)
  583. end))
  584. Script13.Name = "Hurting"
  585. Script13.Parent = mas
  586. table.insert(cors,sandbox(Script13,function()
  587. function onTouched(hit)
  588. local humanoid = hit.Parent:findFirstChild("Humanoid")
  589. if (humanoid ~= nil) then
  590. humanoid.Health = humanoid.Health - 25
  591. end
  592. end
  593.  
  594. script.Parent.Touched:connect(onTouched)
  595. end))
  596. Script14.Name = "qPerfectionWeld"
  597. Script14.Parent = mas
  598. table.insert(cors,sandbox(Script14,function()
  599. -- Created by Quenty (@Quenty, follow me on twitter).
  600. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  601. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  602.  
  603. --[[ INSTRUCTIONS
  604. - Place in the model
  605. - Make sure model is anchored
  606. - That's it. It will weld the model and all children.
  607.  
  608. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  609. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  610. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  611. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  612. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  613. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  614. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  615. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  616.  
  617. 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.
  618. ]]
  619.  
  620. --[[ DOCUMENTATION
  621. - 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.
  622. - Will work in PBS servers
  623. - Will work as long as it starts out with the part anchored
  624. - Stores the relative CFrame as a CFrame value
  625. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  626. - Utilizes a recursive algorith to find all parts in the model
  627. - Will reweld on script reparent if the script is initially parented to a tool.
  628. - Welds as fast as possible
  629. ]]
  630.  
  631. -- qPerfectionWeld.lua
  632. -- Created 10/6/2014
  633. -- Author: Quenty
  634. -- Version 1.0.3
  635.  
  636. -- Updated 10/14/2014 - Updated to 1.0.1
  637. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  638.  
  639. -- Updated 10/14/2014 - Updated to 1.0.2
  640. --- Fixed bug fix.
  641.  
  642. -- Updated 10/14/2014 - Updated to 1.0.3
  643. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  644.  
  645. 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).
  646.  
  647.  
  648. local function CallOnChildren(Instance, FunctionToCall)
  649. -- Calls a function on each of the children of a certain object, using recursion.
  650.  
  651. FunctionToCall(Instance)
  652.  
  653. for _, Child in next, Instance:GetChildren() do
  654. CallOnChildren(Child, FunctionToCall)
  655. end
  656. end
  657.  
  658. local function GetNearestParent(Instance, ClassName)
  659. -- Returns the nearest parent of a certain class, or returns nil
  660.  
  661. local Ancestor = Instance
  662. repeat
  663. Ancestor = Ancestor.Parent
  664. if Ancestor == nil then
  665. return nil
  666. end
  667. until Ancestor:IsA(ClassName)
  668.  
  669. return Ancestor
  670. end
  671.  
  672. local function GetBricks(StartInstance)
  673. local List = {}
  674.  
  675. -- if StartInstance:IsA("BasePart") then
  676. -- List[#List+1] = StartInstance
  677. -- end
  678.  
  679. CallOnChildren(StartInstance, function(Item)
  680. if Item:IsA("BasePart") then
  681. List[#List+1] = Item;
  682. end
  683. end)
  684.  
  685. return List
  686. end
  687.  
  688. local function Modify(Instance, Values)
  689. -- Modifies an Instance by using a table.
  690.  
  691. assert(type(Values) == "table", "Values is not a table");
  692.  
  693. for Index, Value in next, Values do
  694. if type(Index) == "number" then
  695. Value.Parent = Instance
  696. else
  697. Instance[Index] = Value
  698. end
  699. end
  700. return Instance
  701. end
  702.  
  703. local function Make(ClassType, Properties)
  704. -- Using a syntax hack to create a nice way to Make new items.
  705.  
  706. return Modify(Instance.new(ClassType), Properties)
  707. end
  708.  
  709. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  710. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  711.  
  712. local function HasWheelJoint(Part)
  713. for _, SurfaceName in pairs(Surfaces) do
  714. for _, HingSurfaceName in pairs(HingSurfaces) do
  715. if Part[SurfaceName].Name == HingSurfaceName then
  716. return true
  717. end
  718. end
  719. end
  720.  
  721. return false
  722. end
  723.  
  724. local function ShouldBreakJoints(Part)
  725. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  726. -- definitely some edge cases.
  727.  
  728. if NEVER_BREAK_JOINTS then
  729. return false
  730. end
  731.  
  732. if HasWheelJoint(Part) then
  733. return false
  734. end
  735.  
  736. local Connected = Part:GetConnectedParts()
  737.  
  738. if #Connected == 1 then
  739. return false
  740. end
  741.  
  742. for _, Item in pairs(Connected) do
  743. if HasWheelJoint(Item) then
  744. return false
  745. elseif not Item:IsDescendantOf(script.Parent) then
  746. return false
  747. end
  748. end
  749.  
  750. return true
  751. end
  752.  
  753. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  754. --- Weld's 2 parts together
  755. -- @param Part0 The first part
  756. -- @param Part1 The second part (Dependent part most of the time).
  757. -- @param [JointType] The type of joint. Defaults to weld.
  758. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  759. -- @return The weld created.
  760.  
  761. JointType = JointType or "Weld"
  762. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  763.  
  764. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  765. Modify(NewWeld, {
  766. Name = "qCFrameWeldThingy";
  767. Part0 = Part0;
  768. Part1 = Part1;
  769. C0 = CFrame.new();--Part0.CFrame:inverse();
  770. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  771. Parent = Part1;
  772. })
  773.  
  774. if not RelativeValue then
  775. RelativeValue = Make("CFrameValue", {
  776. Parent = Part1;
  777. Name = "qRelativeCFrameWeldValue";
  778. Archivable = true;
  779. Value = NewWeld.C1;
  780. })
  781. end
  782.  
  783. return NewWeld
  784. end
  785.  
  786. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  787. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  788. -- @param MainPart The part to weld the model to (can be in the model).
  789. -- @param [JointType] The type of joint. Defaults to weld.
  790. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  791.  
  792. for _, Part in pairs(Parts) do
  793. if ShouldBreakJoints(Part) then
  794. Part:BreakJoints()
  795. end
  796. end
  797.  
  798. for _, Part in pairs(Parts) do
  799. if Part ~= MainPart then
  800. WeldTogether(MainPart, Part, JointType, MainPart)
  801. end
  802. end
  803.  
  804. if not DoNotUnanchor then
  805. for _, Part in pairs(Parts) do
  806. Part.Anchored = false
  807. end
  808. MainPart.Anchored = false
  809. end
  810. end
  811.  
  812. local function PerfectionWeld()
  813. local Tool = GetNearestParent(script, "Tool")
  814.  
  815. local Parts = GetBricks(script.Parent)
  816. 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]
  817.  
  818. if PrimaryPart then
  819. WeldParts(Parts, PrimaryPart, "Weld", false)
  820. else
  821. warn("qWeld - Unable to weld part")
  822. end
  823.  
  824. return Tool
  825. end
  826.  
  827. local Tool = PerfectionWeld()
  828.  
  829.  
  830. if Tool and script.ClassName == "Script" then
  831. --- Don't bother with local scripts
  832.  
  833. script.Parent.AncestryChanged:connect(function()
  834. PerfectionWeld()
  835. end)
  836. end
  837.  
  838. -- Created by Quenty (@Quenty, follow me on twitter).
  839.  
  840. end))
  841. Part15.Parent = mas
  842. Part15.Material = Enum.Material.Metal
  843. Part15.BrickColor = BrickColor.new("Br. yellowish green")
  844. Part15.Rotation = Vector3.new(0, 0, -90)
  845. Part15.Size = Vector3.new(1.42687118, 1.42687118, 0.891794443)
  846. Part15.CFrame = CFrame.new(-75.0521088, 12.4932079, 37.6790009, 6.29370334e-10, 1, -1.16413892e-10, -1, 6.29370334e-10, 5.69855274e-10, 5.69855274e-10, 1.16413892e-10, 1)
  847. Part15.Color = Color3.new(0.643137, 0.741176, 0.278431)
  848. Part15.Position = Vector3.new(-75.0521088, 12.4932079, 37.6790009)
  849. Part15.Orientation = Vector3.new(0, 0, -90)
  850. Part15.Color = Color3.new(0.643137, 0.741176, 0.278431)
  851. SpecialMesh16.Parent = Part15
  852. SpecialMesh16.MeshId = "rbxassetid://533041434"
  853. SpecialMesh16.Scale = Vector3.new(0.178358868, 0.178358868, 0.178358868)
  854. SpecialMesh16.MeshType = Enum.MeshType.FileMesh
  855. SpecialMesh16.Scale = Vector3.new(0.178358868, 0.178358868, 0.178358868)
  856. Part17.Name = "Handle"
  857. Part17.Parent = mas
  858. Part17.BrickColor = BrickColor.new("Really black")
  859. Part17.Transparency = 1
  860. Part17.Rotation = Vector3.new(-91.0299988, -13.9200001, 88.3699951)
  861. Part17.CanCollide = false
  862. Part17.FormFactor = Enum.FormFactor.Custom
  863. Part17.Shape = Enum.PartType.Ball
  864. Part17.Size = Vector3.new(0.797133029, 0.797133029, 0.797133029)
  865. Part17.CFrame = CFrame.new(-69.7722321, 12.3463202, 36.8118515, 0.0276624784, -0.970244706, -0.240541101, -0.0110988738, -0.240916446, 0.970482469, -0.999555707, -0.0241762139, -0.0174329691)
  866. Part17.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  867. Part17.Position = Vector3.new(-69.7722321, 12.3463202, 36.8118515)
  868. Part17.Orientation = Vector3.new(-76.0400009, -94.1500015, -177.360001)
  869. Part17.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  870. Script18.Parent = Part17
  871. table.insert(cors,sandbox(Script18,function()
  872. function onTouched(hit)
  873. script.Parent.Sound:play()
  874. end
  875. script.Parent.Touched:connect(onTouched)
  876. end))
  877. Script19.Name = "Rage"
  878. Script19.Parent = Part17
  879. table.insert(cors,sandbox(Script19,function()
  880. function onTouched(hit)
  881. script.Parent.ARG:play()
  882. end
  883. script.Parent.Touched:connect(onTouched)
  884. end))
  885. Sound20.Name = "ARG"
  886. Sound20.Parent = Part17
  887. Sound20.SoundId = "rbxassetid://188122609"
  888. Sound20.Volume = 4
  889. Sound21.Parent = Part17
  890. Sound21.SoundId = "rbxassetid://423041325"
  891. Sound21.Volume = 4
  892. Motor6D22.Name = "LeftWrist"
  893. Motor6D22.Parent = mas
  894. Motor6D22.C0 = CFrame.new(-0.0112809651, -4.6205492, -0.0670197308, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  895. Motor6D22.C1 = CFrame.new(-0.0026157822, 0.39213115, -0.104560249, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  896. Motor6D22.Part0 = nil
  897. Motor6D22.Part1 = nil
  898. Attachment23.Name = "LeftElbowRigAttachment"
  899. Attachment23.Parent = mas
  900. Attachment23.CFrame = CFrame.new(-0.0112809436, 0.832676709, -0.0670196936, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  901. Attachment23.Position = Vector3.new(-0.0112809436, 0.832676709, -0.0670196936)
  902. Attachment24.Name = "LeftWristRigAttachment"
  903. Attachment24.Parent = mas
  904. Attachment24.CFrame = CFrame.new(-0.0112809436, -4.62054396, -0.0670196936, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  905. Attachment24.Position = Vector3.new(-0.0112809436, -4.62054396, -0.0670196936)
  906. Vector3Value25.Name = "OriginalSize"
  907. Vector3Value25.Parent = mas
  908. Vector3Value25.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  909. Script26.Name = "Hurting"
  910. Script26.Parent = mas
  911. table.insert(cors,sandbox(Script26,function()
  912. function onTouched(hit)
  913. local humanoid = hit.Parent:findFirstChild("Humanoid")
  914. if (humanoid ~= nil) then
  915. humanoid.Health = humanoid.Health - 25
  916. end
  917. end
  918.  
  919. script.Parent.Touched:connect(onTouched)
  920. end))
  921. Script27.Name = "ShieldScript"
  922. Script27.Parent = mas
  923. table.insert(cors,sandbox(Script27,function()
  924. function ot(hit)
  925. ch = hit:GetChildren()
  926. for i = 1, #ch do
  927. if ch[i].className == "BodyVelocity" then
  928. ch[i].velocity = ch[i].velocity*-1
  929. end
  930. end
  931. if hit.Parent ~= nil then
  932. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  933. if hit.Parent ~= script.Parent.Parent then
  934. if hit.Parent:FindFirstChild("Torso") ~= nil then
  935. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  936. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  937. end
  938. hit.Parent.Humanoid.PlatformStand = true
  939. end
  940. else
  941. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  942. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  943. hit:breakJoints()
  944. if hit.Anchored == false then
  945. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  946. end
  947. end
  948. else
  949. hit:breakJoints()
  950. if hit.Anchored == false then
  951. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  952. end
  953. end
  954. end
  955. end
  956. if hit.Parent ~= nil then
  957. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  958. if hit.Parent ~= script.Parent.Parent then
  959. wait(0.5)
  960. hit.Parent.Humanoid.PlatformStand = false
  961. end
  962. end
  963. end
  964. end
  965. function remove(child)
  966. child:Remove()
  967. end
  968. script.Parent.Touched:connect(ot)
  969. script.Parent.ChildAdded:connect(remove)
  970. end))
  971. Motor6D28.Name = "LeftElbow"
  972. Motor6D28.Parent = mas
  973. Motor6D28.C0 = CFrame.new(-0.0112769287, -1.78210199, -0.0639314502, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  974. Motor6D28.C1 = CFrame.new(-0.0112809651, 0.832677782, -0.0670197308, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  975. Motor6D28.Part0 = nil
  976. Motor6D28.Part1 = nil
  977. Attachment29.Name = "LeftKneeRigAttachment"
  978. Attachment29.Parent = mas
  979. Attachment29.CFrame = CFrame.new(-0.0259127542, 1.96312129, 0.00206926116, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  980. Attachment29.Position = Vector3.new(-0.0259127542, 1.96312129, 0.00206926116)
  981. Attachment30.Name = "LeftAnkleRigAttachment"
  982. Attachment30.Parent = mas
  983. Attachment30.CFrame = CFrame.new(-0.0259127542, -4.80933285, 0.00206926116, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  984. Attachment30.Position = Vector3.new(-0.0259127542, -4.80933285, 0.00206926116)
  985. Vector3Value31.Name = "OriginalSize"
  986. Vector3Value31.Parent = mas
  987. Vector3Value31.Value = Vector3.new(1.00027585, 1.48964536, 1.00032866)
  988. Motor6D32.Name = "LeftKnee"
  989. Motor6D32.Parent = mas
  990. Motor6D32.C0 = CFrame.new(-0.0259127952, -1.79122257, 0.00397367822, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  991. Motor6D32.C1 = CFrame.new(-0.0259127952, 1.9631238, 0.00206926349, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  992. Motor6D32.Part0 = nil
  993. Motor6D32.Part1 = nil
  994. Attachment33.Name = "LeftShoulderRigAttachment"
  995. Attachment33.Parent = mas
  996. Attachment33.CFrame = CFrame.new(1.67933047, 3.09320259, -0.0639313832, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  997. Attachment33.Position = Vector3.new(1.67933047, 3.09320259, -0.0639313832)
  998. Attachment34.Name = "LeftElbowRigAttachment"
  999. Attachment34.Parent = mas
  1000. Attachment34.CFrame = CFrame.new(-0.0112769119, -1.78209805, -0.0639313832, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1001. Attachment34.Position = Vector3.new(-0.0112769119, -1.78209805, -0.0639313832)
  1002. Attachment35.Name = "LeftShoulderAttachment"
  1003. Attachment35.Parent = mas
  1004. Attachment35.CFrame = CFrame.new(-0.0818408057, 4.80697584, -0.0639313832, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1005. Attachment35.Position = Vector3.new(-0.0818408057, 4.80697584, -0.0639313832)
  1006. Vector3Value36.Name = "OriginalSize"
  1007. Vector3Value36.Parent = mas
  1008. Vector3Value36.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
  1009. Motor6D37.Name = "LeftShoulder"
  1010. Motor6D37.Parent = mas
  1011. Motor6D37.C0 = CFrame.new(-8.46254921, 3.768255, -0.105385743, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1012. Motor6D37.C1 = CFrame.new(1.67933309, 3.09320617, -0.0639314502, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1013. Motor6D37.Part0 = nil
  1014. Motor6D37.Part1 = nil
  1015. Attachment38.Name = "LeftHipRigAttachment"
  1016. Attachment38.Parent = mas
  1017. Attachment38.CFrame = CFrame.new(-0.0259127542, 3.28540945, 0.00465091784, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1018. Attachment38.Position = Vector3.new(-0.0259127542, 3.28540945, 0.00465091784)
  1019. Attachment39.Name = "LeftKneeRigAttachment"
  1020. Attachment39.Parent = mas
  1021. Attachment39.CFrame = CFrame.new(-0.0259127542, -1.7912184, 0.00397367449, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1022. Attachment39.Position = Vector3.new(-0.0259127542, -1.7912184, 0.00397367449)
  1023. Vector3Value40.Name = "OriginalSize"
  1024. Vector3Value40.Parent = mas
  1025. Vector3Value40.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  1026. Motor6D41.Name = "LeftHip"
  1027. Motor6D41.Parent = mas
  1028. Motor6D41.C0 = CFrame.new(-3.41684103, -1.64612925, 0.00831584446, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1029. Motor6D41.C1 = CFrame.new(-0.0259127952, 3.28541422, 0.00465092249, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1030. Motor6D41.Part0 = nil
  1031. Motor6D41.Part1 = nil
  1032. Attachment42.Name = "RootRigAttachment"
  1033. Attachment42.Parent = mas
  1034. Attachment42.CFrame = CFrame.new(0.00189744879, 0.900992215, -0.0966572538, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1035. Attachment42.Position = Vector3.new(0.00189744879, 0.900992215, -0.0966572538)
  1036. Attachment43.Name = "WaistRigAttachment"
  1037. Attachment43.Parent = mas
  1038. Attachment43.CFrame = CFrame.new(0.00189744879, 3.63778305, -0.0966572538, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1039. Attachment43.Position = Vector3.new(0.00189744879, 3.63778305, -0.0966572538)
  1040. Attachment44.Name = "LeftHipRigAttachment"
  1041. Attachment44.Parent = mas
  1042. Attachment44.CFrame = CFrame.new(-3.41683674, -1.64612877, 0.00831583515, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1043. Attachment44.Position = Vector3.new(-3.41683674, -1.64612877, 0.00831583515)
  1044. Attachment45.Name = "RightHipRigAttachment"
  1045. Attachment45.Parent = mas
  1046. Attachment45.CFrame = CFrame.new(3.4206326, -1.64748085, 0.00696135126, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1047. Attachment45.Position = Vector3.new(3.4206326, -1.64748085, 0.00696135126)
  1048. Attachment46.Name = "WaistFrontAttachment"
  1049. Attachment46.Parent = mas
  1050. Attachment46.CFrame = CFrame.new(0.00189744879, -0.452618867, -3.39475894, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1051. Attachment46.Position = Vector3.new(0.00189744879, -0.452618867, -3.39475894)
  1052. Attachment47.Name = "WaistCenterAttachment"
  1053. Attachment47.Parent = mas
  1054. Attachment47.CFrame = CFrame.new(0.00189744879, -0.452618867, -0.0966572538, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1055. Attachment47.Position = Vector3.new(0.00189744879, -0.452618867, -0.0966572538)
  1056. Attachment48.Name = "WaistBackAttachment"
  1057. Attachment48.Parent = mas
  1058. Attachment48.CFrame = CFrame.new(0.00189744879, -0.452618867, 3.32433915, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1059. Attachment48.Position = Vector3.new(0.00189744879, -0.452618867, 3.32433915)
  1060. Vector3Value49.Name = "OriginalSize"
  1061. Vector3Value49.Parent = mas
  1062. Vector3Value49.Value = Vector3.new(2.00017595, 0.400037616, 1.00021255)
  1063. Script50.Name = "Hurting"
  1064. Script50.Parent = mas
  1065. table.insert(cors,sandbox(Script50,function()
  1066. function onTouched(hit)
  1067. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1068. if (humanoid ~= nil) then
  1069. humanoid.Health = humanoid.Health - 25
  1070. end
  1071. end
  1072.  
  1073. script.Parent.Touched:connect(onTouched)
  1074. end))
  1075. Script51.Name = "ShieldScript"
  1076. Script51.Parent = mas
  1077. table.insert(cors,sandbox(Script51,function()
  1078. function ot(hit)
  1079. ch = hit:GetChildren()
  1080. for i = 1, #ch do
  1081. if ch[i].className == "BodyVelocity" then
  1082. ch[i].velocity = ch[i].velocity*-1
  1083. end
  1084. end
  1085. if hit.Parent ~= nil then
  1086. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1087. if hit.Parent ~= script.Parent.Parent then
  1088. if hit.Parent:FindFirstChild("Torso") ~= nil then
  1089. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1090. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1091. end
  1092. hit.Parent.Humanoid.PlatformStand = true
  1093. end
  1094. else
  1095. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  1096. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  1097. hit:breakJoints()
  1098. if hit.Anchored == false then
  1099. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1100. end
  1101. end
  1102. else
  1103. hit:breakJoints()
  1104. if hit.Anchored == false then
  1105. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1106. end
  1107. end
  1108. end
  1109. end
  1110. if hit.Parent ~= nil then
  1111. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1112. if hit.Parent ~= script.Parent.Parent then
  1113. wait(0.5)
  1114. hit.Parent.Humanoid.PlatformStand = false
  1115. end
  1116. end
  1117. end
  1118. end
  1119. function remove(child)
  1120. child:Remove()
  1121. end
  1122. script.Parent.Touched:connect(ot)
  1123. script.Parent.ChildAdded:connect(remove)
  1124. end))
  1125. Motor6D52.Name = "Root"
  1126. Motor6D52.Parent = mas
  1127. Motor6D52.C1 = CFrame.new(0.00189745135, 0.900993049, -0.0966572911, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1128. Motor6D52.Part0 = Part111
  1129. Motor6D52.Part1 = nil
  1130. Script53.Name = "Respawn"
  1131. Script53.Parent = Model0
  1132. table.insert(cors,sandbox(Script53,function()
  1133. name="NPC"
  1134.  
  1135. robo=script.Parent:clone()
  1136.  
  1137. while true do
  1138. wait(15)
  1139. if script.Parent.NPC.Health<1 then
  1140. robot=robo:clone()
  1141. robot.Parent=script.Parent.Parent
  1142. robot:makeJoints()
  1143. script.Parent:remove()
  1144. end
  1145. end
  1146.  
  1147.  
  1148.  
  1149.  
  1150. end))
  1151. Attachment54.Name = "RightAnkleRigAttachment"
  1152. Attachment54.Parent = mas
  1153. Attachment54.CFrame = CFrame.new(0.061065957, 0.215656459, 0.00105346437, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1154. Attachment54.Position = Vector3.new(0.061065957, 0.215656459, 0.00105346437)
  1155. Vector3Value55.Name = "OriginalSize"
  1156. Vector3Value55.Parent = mas
  1157. Vector3Value55.Value = Vector3.new(1.00063133, 0.335407376, 1.00020337)
  1158. Script56.Name = "ShieldScript"
  1159. Script56.Parent = mas
  1160. table.insert(cors,sandbox(Script56,function()
  1161. function ot(hit)
  1162. ch = hit:GetChildren()
  1163. for i = 1, #ch do
  1164. if ch[i].className == "BodyVelocity" then
  1165. ch[i].velocity = ch[i].velocity*-1
  1166. end
  1167. end
  1168. if hit.Parent ~= nil then
  1169. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1170. if hit.Parent ~= script.Parent.Parent then
  1171. if hit.Parent:FindFirstChild("Torso") ~= nil then
  1172. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1173. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1174. end
  1175. hit.Parent.Humanoid.PlatformStand = true
  1176. end
  1177. else
  1178. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  1179. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  1180. hit:breakJoints()
  1181. if hit.Anchored == false then
  1182. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1183. end
  1184. end
  1185. else
  1186. hit:breakJoints()
  1187. if hit.Anchored == false then
  1188. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1189. end
  1190. end
  1191. end
  1192. end
  1193. if hit.Parent ~= nil then
  1194. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1195. if hit.Parent ~= script.Parent.Parent then
  1196. wait(0.5)
  1197. hit.Parent.Humanoid.PlatformStand = false
  1198. end
  1199. end
  1200. end
  1201. end
  1202. function remove(child)
  1203. child:Remove()
  1204. end
  1205. script.Parent.Touched:connect(ot)
  1206. script.Parent.ChildAdded:connect(remove)
  1207. end))
  1208. Script57.Name = "Hurting"
  1209. Script57.Parent = mas
  1210. table.insert(cors,sandbox(Script57,function()
  1211. function onTouched(hit)
  1212. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1213. if (humanoid ~= nil) then
  1214. humanoid.Health = humanoid.Health - 25
  1215. end
  1216. end
  1217.  
  1218. script.Parent.Touched:connect(onTouched)
  1219. end))
  1220. Script58.Name = "qPerfectionWeld"
  1221. Script58.Parent = mas
  1222. table.insert(cors,sandbox(Script58,function()
  1223. -- Created by Quenty (@Quenty, follow me on twitter).
  1224. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1225. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1226.  
  1227. --[[ INSTRUCTIONS
  1228. - Place in the model
  1229. - Make sure model is anchored
  1230. - That's it. It will weld the model and all children.
  1231.  
  1232. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1233. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1234. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1235. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1236. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1237. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1238. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1239. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1240.  
  1241. 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.
  1242. ]]
  1243.  
  1244. --[[ DOCUMENTATION
  1245. - 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.
  1246. - Will work in PBS servers
  1247. - Will work as long as it starts out with the part anchored
  1248. - Stores the relative CFrame as a CFrame value
  1249. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1250. - Utilizes a recursive algorith to find all parts in the model
  1251. - Will reweld on script reparent if the script is initially parented to a tool.
  1252. - Welds as fast as possible
  1253. ]]
  1254.  
  1255. -- qPerfectionWeld.lua
  1256. -- Created 10/6/2014
  1257. -- Author: Quenty
  1258. -- Version 1.0.3
  1259.  
  1260. -- Updated 10/14/2014 - Updated to 1.0.1
  1261. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1262.  
  1263. -- Updated 10/14/2014 - Updated to 1.0.2
  1264. --- Fixed bug fix.
  1265.  
  1266. -- Updated 10/14/2014 - Updated to 1.0.3
  1267. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1268.  
  1269. 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).
  1270.  
  1271.  
  1272. local function CallOnChildren(Instance, FunctionToCall)
  1273. -- Calls a function on each of the children of a certain object, using recursion.
  1274.  
  1275. FunctionToCall(Instance)
  1276.  
  1277. for _, Child in next, Instance:GetChildren() do
  1278. CallOnChildren(Child, FunctionToCall)
  1279. end
  1280. end
  1281.  
  1282. local function GetNearestParent(Instance, ClassName)
  1283. -- Returns the nearest parent of a certain class, or returns nil
  1284.  
  1285. local Ancestor = Instance
  1286. repeat
  1287. Ancestor = Ancestor.Parent
  1288. if Ancestor == nil then
  1289. return nil
  1290. end
  1291. until Ancestor:IsA(ClassName)
  1292.  
  1293. return Ancestor
  1294. end
  1295.  
  1296. local function GetBricks(StartInstance)
  1297. local List = {}
  1298.  
  1299. -- if StartInstance:IsA("BasePart") then
  1300. -- List[#List+1] = StartInstance
  1301. -- end
  1302.  
  1303. CallOnChildren(StartInstance, function(Item)
  1304. if Item:IsA("BasePart") then
  1305. List[#List+1] = Item;
  1306. end
  1307. end)
  1308.  
  1309. return List
  1310. end
  1311.  
  1312. local function Modify(Instance, Values)
  1313. -- Modifies an Instance by using a table.
  1314.  
  1315. assert(type(Values) == "table", "Values is not a table");
  1316.  
  1317. for Index, Value in next, Values do
  1318. if type(Index) == "number" then
  1319. Value.Parent = Instance
  1320. else
  1321. Instance[Index] = Value
  1322. end
  1323. end
  1324. return Instance
  1325. end
  1326.  
  1327. local function Make(ClassType, Properties)
  1328. -- Using a syntax hack to create a nice way to Make new items.
  1329.  
  1330. return Modify(Instance.new(ClassType), Properties)
  1331. end
  1332.  
  1333. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1334. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1335.  
  1336. local function HasWheelJoint(Part)
  1337. for _, SurfaceName in pairs(Surfaces) do
  1338. for _, HingSurfaceName in pairs(HingSurfaces) do
  1339. if Part[SurfaceName].Name == HingSurfaceName then
  1340. return true
  1341. end
  1342. end
  1343. end
  1344.  
  1345. return false
  1346. end
  1347.  
  1348. local function ShouldBreakJoints(Part)
  1349. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1350. -- definitely some edge cases.
  1351.  
  1352. if NEVER_BREAK_JOINTS then
  1353. return false
  1354. end
  1355.  
  1356. if HasWheelJoint(Part) then
  1357. return false
  1358. end
  1359.  
  1360. local Connected = Part:GetConnectedParts()
  1361.  
  1362. if #Connected == 1 then
  1363. return false
  1364. end
  1365.  
  1366. for _, Item in pairs(Connected) do
  1367. if HasWheelJoint(Item) then
  1368. return false
  1369. elseif not Item:IsDescendantOf(script.Parent) then
  1370. return false
  1371. end
  1372. end
  1373.  
  1374. return true
  1375. end
  1376.  
  1377. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1378. --- Weld's 2 parts together
  1379. -- @param Part0 The first part
  1380. -- @param Part1 The second part (Dependent part most of the time).
  1381. -- @param [JointType] The type of joint. Defaults to weld.
  1382. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1383. -- @return The weld created.
  1384.  
  1385. JointType = JointType or "Weld"
  1386. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1387.  
  1388. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1389. Modify(NewWeld, {
  1390. Name = "qCFrameWeldThingy";
  1391. Part0 = Part0;
  1392. Part1 = Part1;
  1393. C0 = CFrame.new();--Part0.CFrame:inverse();
  1394. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1395. Parent = Part1;
  1396. })
  1397.  
  1398. if not RelativeValue then
  1399. RelativeValue = Make("CFrameValue", {
  1400. Parent = Part1;
  1401. Name = "qRelativeCFrameWeldValue";
  1402. Archivable = true;
  1403. Value = NewWeld.C1;
  1404. })
  1405. end
  1406.  
  1407. return NewWeld
  1408. end
  1409.  
  1410. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1411. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1412. -- @param MainPart The part to weld the model to (can be in the model).
  1413. -- @param [JointType] The type of joint. Defaults to weld.
  1414. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1415.  
  1416. for _, Part in pairs(Parts) do
  1417. if ShouldBreakJoints(Part) then
  1418. Part:BreakJoints()
  1419. end
  1420. end
  1421.  
  1422. for _, Part in pairs(Parts) do
  1423. if Part ~= MainPart then
  1424. WeldTogether(MainPart, Part, JointType, MainPart)
  1425. end
  1426. end
  1427.  
  1428. if not DoNotUnanchor then
  1429. for _, Part in pairs(Parts) do
  1430. Part.Anchored = false
  1431. end
  1432. MainPart.Anchored = false
  1433. end
  1434. end
  1435.  
  1436. local function PerfectionWeld()
  1437. local Tool = GetNearestParent(script, "Tool")
  1438.  
  1439. local Parts = GetBricks(script.Parent)
  1440. 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]
  1441.  
  1442. if PrimaryPart then
  1443. WeldParts(Parts, PrimaryPart, "Weld", false)
  1444. else
  1445. warn("qWeld - Unable to weld part")
  1446. end
  1447.  
  1448. return Tool
  1449. end
  1450.  
  1451. local Tool = PerfectionWeld()
  1452.  
  1453.  
  1454. if Tool and script.ClassName == "Script" then
  1455. --- Don't bother with local scripts
  1456.  
  1457. script.Parent.AncestryChanged:connect(function()
  1458. PerfectionWeld()
  1459. end)
  1460. end
  1461.  
  1462. -- Created by Quenty (@Quenty, follow me on twitter).
  1463.  
  1464. end))
  1465. Script59.Parent = mas
  1466. table.insert(cors,sandbox(Script59,function()
  1467. function onTouched(hit)
  1468. script.Parent.Sound:play()
  1469. end
  1470. script.Parent.Touched:connect(onTouched)
  1471. end))
  1472. Sound60.Parent = mas
  1473. Sound60.Pitch = 1.3999999761581
  1474. Sound60.SoundId = "rbxassetid://198360408"
  1475. Sound60.Volume = 4
  1476. Motor6D61.Name = "RightAnkle"
  1477. Motor6D61.Parent = mas
  1478. Motor6D61.C0 = CFrame.new(0.0259127952, -4.8134017, 0.00191943871, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1479. Motor6D61.C1 = CFrame.new(0.0610660091, 0.215656728, 0.0010534653, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1480. Motor6D61.Part0 = nil
  1481. Motor6D61.Part1 = nil
  1482. Attachment62.Name = "RightWristRigAttachment"
  1483. Attachment62.Parent = mas
  1484. Attachment62.CFrame = CFrame.new(0.00585886464, 0.393526614, -0.10456007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1485. Attachment62.Position = Vector3.new(0.00585886464, 0.393526614, -0.10456007)
  1486. Attachment63.Name = "RightGripAttachment"
  1487. Attachment63.Parent = mas
  1488. Attachment63.Rotation = Vector3.new(-90, -0, -0)
  1489. Attachment63.CFrame = CFrame.new(0.0735833496, -1.1422714, -0.104559548, 1, 0, -0, 0, 6.12323426e-17, 1, 0, -1, 6.12323426e-17)
  1490. Attachment63.Position = Vector3.new(0.0735833496, -1.1422714, -0.104559548)
  1491. Attachment63.Orientation = Vector3.new(-90, -0, 0)
  1492. Vector3Value64.Name = "OriginalSize"
  1493. Vector3Value64.Parent = mas
  1494. Vector3Value64.Value = Vector3.new(0.999299049, 0.335255772, 1.00029743)
  1495. Script65.Name = "ShieldScript"
  1496. Script65.Parent = mas
  1497. table.insert(cors,sandbox(Script65,function()
  1498. function ot(hit)
  1499. ch = hit:GetChildren()
  1500. for i = 1, #ch do
  1501. if ch[i].className == "BodyVelocity" then
  1502. ch[i].velocity = ch[i].velocity*-1
  1503. end
  1504. end
  1505. if hit.Parent ~= nil then
  1506. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1507. if hit.Parent ~= script.Parent.Parent then
  1508. if hit.Parent:FindFirstChild("Torso") ~= nil then
  1509. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1510. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1511. end
  1512. hit.Parent.Humanoid.PlatformStand = true
  1513. end
  1514. else
  1515. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  1516. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  1517. hit:breakJoints()
  1518. if hit.Anchored == false then
  1519. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1520. end
  1521. end
  1522. else
  1523. hit:breakJoints()
  1524. if hit.Anchored == false then
  1525. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1526. end
  1527. end
  1528. end
  1529. end
  1530. if hit.Parent ~= nil then
  1531. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1532. if hit.Parent ~= script.Parent.Parent then
  1533. wait(0.5)
  1534. hit.Parent.Humanoid.PlatformStand = false
  1535. end
  1536. end
  1537. end
  1538. end
  1539. function remove(child)
  1540. child:Remove()
  1541. end
  1542. script.Parent.Touched:connect(ot)
  1543. script.Parent.ChildAdded:connect(remove)
  1544. end))
  1545. Script66.Name = "Hurting"
  1546. Script66.Parent = mas
  1547. table.insert(cors,sandbox(Script66,function()
  1548. function onTouched(hit)
  1549. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1550. if (humanoid ~= nil) then
  1551. humanoid.Health = humanoid.Health - 25
  1552. end
  1553. end
  1554.  
  1555. script.Parent.Touched:connect(onTouched)
  1556. end))
  1557. Script67.Name = "qPerfectionWeld"
  1558. Script67.Parent = mas
  1559. table.insert(cors,sandbox(Script67,function()
  1560. -- Created by Quenty (@Quenty, follow me on twitter).
  1561. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  1562. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  1563.  
  1564. --[[ INSTRUCTIONS
  1565. - Place in the model
  1566. - Make sure model is anchored
  1567. - That's it. It will weld the model and all children.
  1568.  
  1569. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1570. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1571. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1572. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1573. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1574. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1575. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1576. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  1577.  
  1578. 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.
  1579. ]]
  1580.  
  1581. --[[ DOCUMENTATION
  1582. - 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.
  1583. - Will work in PBS servers
  1584. - Will work as long as it starts out with the part anchored
  1585. - Stores the relative CFrame as a CFrame value
  1586. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  1587. - Utilizes a recursive algorith to find all parts in the model
  1588. - Will reweld on script reparent if the script is initially parented to a tool.
  1589. - Welds as fast as possible
  1590. ]]
  1591.  
  1592. -- qPerfectionWeld.lua
  1593. -- Created 10/6/2014
  1594. -- Author: Quenty
  1595. -- Version 1.0.3
  1596.  
  1597. -- Updated 10/14/2014 - Updated to 1.0.1
  1598. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  1599.  
  1600. -- Updated 10/14/2014 - Updated to 1.0.2
  1601. --- Fixed bug fix.
  1602.  
  1603. -- Updated 10/14/2014 - Updated to 1.0.3
  1604. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  1605.  
  1606. 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).
  1607.  
  1608.  
  1609. local function CallOnChildren(Instance, FunctionToCall)
  1610. -- Calls a function on each of the children of a certain object, using recursion.
  1611.  
  1612. FunctionToCall(Instance)
  1613.  
  1614. for _, Child in next, Instance:GetChildren() do
  1615. CallOnChildren(Child, FunctionToCall)
  1616. end
  1617. end
  1618.  
  1619. local function GetNearestParent(Instance, ClassName)
  1620. -- Returns the nearest parent of a certain class, or returns nil
  1621.  
  1622. local Ancestor = Instance
  1623. repeat
  1624. Ancestor = Ancestor.Parent
  1625. if Ancestor == nil then
  1626. return nil
  1627. end
  1628. until Ancestor:IsA(ClassName)
  1629.  
  1630. return Ancestor
  1631. end
  1632.  
  1633. local function GetBricks(StartInstance)
  1634. local List = {}
  1635.  
  1636. -- if StartInstance:IsA("BasePart") then
  1637. -- List[#List+1] = StartInstance
  1638. -- end
  1639.  
  1640. CallOnChildren(StartInstance, function(Item)
  1641. if Item:IsA("BasePart") then
  1642. List[#List+1] = Item;
  1643. end
  1644. end)
  1645.  
  1646. return List
  1647. end
  1648.  
  1649. local function Modify(Instance, Values)
  1650. -- Modifies an Instance by using a table.
  1651.  
  1652. assert(type(Values) == "table", "Values is not a table");
  1653.  
  1654. for Index, Value in next, Values do
  1655. if type(Index) == "number" then
  1656. Value.Parent = Instance
  1657. else
  1658. Instance[Index] = Value
  1659. end
  1660. end
  1661. return Instance
  1662. end
  1663.  
  1664. local function Make(ClassType, Properties)
  1665. -- Using a syntax hack to create a nice way to Make new items.
  1666.  
  1667. return Modify(Instance.new(ClassType), Properties)
  1668. end
  1669.  
  1670. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  1671. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  1672.  
  1673. local function HasWheelJoint(Part)
  1674. for _, SurfaceName in pairs(Surfaces) do
  1675. for _, HingSurfaceName in pairs(HingSurfaces) do
  1676. if Part[SurfaceName].Name == HingSurfaceName then
  1677. return true
  1678. end
  1679. end
  1680. end
  1681.  
  1682. return false
  1683. end
  1684.  
  1685. local function ShouldBreakJoints(Part)
  1686. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  1687. -- definitely some edge cases.
  1688.  
  1689. if NEVER_BREAK_JOINTS then
  1690. return false
  1691. end
  1692.  
  1693. if HasWheelJoint(Part) then
  1694. return false
  1695. end
  1696.  
  1697. local Connected = Part:GetConnectedParts()
  1698.  
  1699. if #Connected == 1 then
  1700. return false
  1701. end
  1702.  
  1703. for _, Item in pairs(Connected) do
  1704. if HasWheelJoint(Item) then
  1705. return false
  1706. elseif not Item:IsDescendantOf(script.Parent) then
  1707. return false
  1708. end
  1709. end
  1710.  
  1711. return true
  1712. end
  1713.  
  1714. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  1715. --- Weld's 2 parts together
  1716. -- @param Part0 The first part
  1717. -- @param Part1 The second part (Dependent part most of the time).
  1718. -- @param [JointType] The type of joint. Defaults to weld.
  1719. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  1720. -- @return The weld created.
  1721.  
  1722. JointType = JointType or "Weld"
  1723. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  1724.  
  1725. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  1726. Modify(NewWeld, {
  1727. Name = "qCFrameWeldThingy";
  1728. Part0 = Part0;
  1729. Part1 = Part1;
  1730. C0 = CFrame.new();--Part0.CFrame:inverse();
  1731. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  1732. Parent = Part1;
  1733. })
  1734.  
  1735. if not RelativeValue then
  1736. RelativeValue = Make("CFrameValue", {
  1737. Parent = Part1;
  1738. Name = "qRelativeCFrameWeldValue";
  1739. Archivable = true;
  1740. Value = NewWeld.C1;
  1741. })
  1742. end
  1743.  
  1744. return NewWeld
  1745. end
  1746.  
  1747. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  1748. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  1749. -- @param MainPart The part to weld the model to (can be in the model).
  1750. -- @param [JointType] The type of joint. Defaults to weld.
  1751. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  1752.  
  1753. for _, Part in pairs(Parts) do
  1754. if ShouldBreakJoints(Part) then
  1755. Part:BreakJoints()
  1756. end
  1757. end
  1758.  
  1759. for _, Part in pairs(Parts) do
  1760. if Part ~= MainPart then
  1761. WeldTogether(MainPart, Part, JointType, MainPart)
  1762. end
  1763. end
  1764.  
  1765. if not DoNotUnanchor then
  1766. for _, Part in pairs(Parts) do
  1767. Part.Anchored = false
  1768. end
  1769. MainPart.Anchored = false
  1770. end
  1771. end
  1772.  
  1773. local function PerfectionWeld()
  1774. local Tool = GetNearestParent(script, "Tool")
  1775.  
  1776. local Parts = GetBricks(script.Parent)
  1777. 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]
  1778.  
  1779. if PrimaryPart then
  1780. WeldParts(Parts, PrimaryPart, "Weld", false)
  1781. else
  1782. warn("qWeld - Unable to weld part")
  1783. end
  1784.  
  1785. return Tool
  1786. end
  1787.  
  1788. local Tool = PerfectionWeld()
  1789.  
  1790.  
  1791. if Tool and script.ClassName == "Script" then
  1792. --- Don't bother with local scripts
  1793.  
  1794. script.Parent.AncestryChanged:connect(function()
  1795. PerfectionWeld()
  1796. end)
  1797. end
  1798.  
  1799. -- Created by Quenty (@Quenty, follow me on twitter).
  1800.  
  1801. end))
  1802. Part68.Parent = mas
  1803. Part68.Material = Enum.Material.Metal
  1804. Part68.BrickColor = BrickColor.new("Br. yellowish green")
  1805. Part68.Rotation = Vector3.new(0, 0, -90)
  1806. Part68.Size = Vector3.new(1.42687118, 1.42687118, 0.891794443)
  1807. Part68.CFrame = CFrame.new(-74.3388443, 12.314908, 57.6555862, 6.29370334e-10, 1, -1.16413892e-10, -1, 6.29370334e-10, 5.69855274e-10, 5.69855274e-10, 1.16413892e-10, 1)
  1808. Part68.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1809. Part68.Position = Vector3.new(-74.3388443, 12.314908, 57.6555862)
  1810. Part68.Orientation = Vector3.new(0, 0, -90)
  1811. Part68.Color = Color3.new(0.643137, 0.741176, 0.278431)
  1812. SpecialMesh69.Parent = Part68
  1813. SpecialMesh69.MeshId = "rbxassetid://533038794"
  1814. SpecialMesh69.Scale = Vector3.new(0.178358868, 0.178358868, 0.178358868)
  1815. SpecialMesh69.MeshType = Enum.MeshType.FileMesh
  1816. SpecialMesh69.Scale = Vector3.new(0.178358868, 0.178358868, 0.178358868)
  1817. Part70.Name = "Handle"
  1818. Part70.Parent = mas
  1819. Part70.BrickColor = BrickColor.new("Really black")
  1820. Part70.Transparency = 1
  1821. Part70.Rotation = Vector3.new(-91.0299988, -13.9200001, 88.3699951)
  1822. Part70.CanCollide = false
  1823. Part70.FormFactor = Enum.FormFactor.Custom
  1824. Part70.Shape = Enum.PartType.Ball
  1825. Part70.Size = Vector3.new(0.797133029, 0.797133029, 0.797133029)
  1826. Part70.CFrame = CFrame.new(-69.937561, 11.2521181, 58.4872742, 0.0276624784, -0.970244706, -0.240541101, -0.0110988738, -0.240916446, 0.970482469, -0.999555707, -0.0241762139, -0.0174329691)
  1827. Part70.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  1828. Part70.Position = Vector3.new(-69.937561, 11.2521181, 58.4872742)
  1829. Part70.Orientation = Vector3.new(-76.0400009, -94.1500015, -177.360001)
  1830. Part70.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  1831. Script71.Parent = Part70
  1832. table.insert(cors,sandbox(Script71,function()
  1833. function onTouched(hit)
  1834. script.Parent.Sound:play()
  1835. end
  1836. script.Parent.Touched:connect(onTouched)
  1837. end))
  1838. Script72.Name = "Rage"
  1839. Script72.Parent = Part70
  1840. table.insert(cors,sandbox(Script72,function()
  1841. function onTouched(hit)
  1842. script.Parent.ARG:play()
  1843. end
  1844. script.Parent.Touched:connect(onTouched)
  1845. end))
  1846. Sound73.Parent = Part70
  1847. Sound73.SoundId = "rbxassetid://423041356"
  1848. Sound73.Volume = 4
  1849. Sound74.Name = "ARG"
  1850. Sound74.Parent = Part70
  1851. Sound74.SoundId = "rbxassetid://188122609"
  1852. Sound74.Volume = 4
  1853. Motor6D75.Name = "RightWrist"
  1854. Motor6D75.Parent = mas
  1855. Motor6D75.C0 = CFrame.new(0.014524051, -4.61915302, -0.067019932, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1856. Motor6D75.C1 = CFrame.new(0.00585886789, 0.393527001, -0.104560249, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1857. Motor6D75.Part0 = nil
  1858. Motor6D75.Part1 = nil
  1859. Attachment76.Name = "RightWristRigAttachment"
  1860. Attachment76.Parent = mas
  1861. Attachment76.CFrame = CFrame.new(0.0145240296, -4.61914921, -0.0670198351, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1862. Attachment76.Position = Vector3.new(0.0145240296, -4.61914921, -0.0670198351)
  1863. Attachment77.Name = "RightElbowRigAttachment"
  1864. Attachment77.Parent = mas
  1865. Attachment77.CFrame = CFrame.new(0.0145240296, 0.832676709, -0.0670198351, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1866. Attachment77.Position = Vector3.new(0.0145240296, 0.832676709, -0.0670198351)
  1867. Vector3Value78.Name = "OriginalSize"
  1868. Vector3Value78.Parent = mas
  1869. Vector3Value78.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  1870. Script79.Name = "Hurting"
  1871. Script79.Parent = mas
  1872. table.insert(cors,sandbox(Script79,function()
  1873. function onTouched(hit)
  1874. local humanoid = hit.Parent:findFirstChild("Humanoid")
  1875. if (humanoid ~= nil) then
  1876. humanoid.Health = humanoid.Health - 25
  1877. end
  1878. end
  1879.  
  1880. script.Parent.Touched:connect(onTouched)
  1881. end))
  1882. Script80.Name = "ShieldScript"
  1883. Script80.Parent = mas
  1884. table.insert(cors,sandbox(Script80,function()
  1885. function ot(hit)
  1886. ch = hit:GetChildren()
  1887. for i = 1, #ch do
  1888. if ch[i].className == "BodyVelocity" then
  1889. ch[i].velocity = ch[i].velocity*-1
  1890. end
  1891. end
  1892. if hit.Parent ~= nil then
  1893. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1894. if hit.Parent ~= script.Parent.Parent then
  1895. if hit.Parent:FindFirstChild("Torso") ~= nil then
  1896. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1897. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  1898. end
  1899. hit.Parent.Humanoid.PlatformStand = true
  1900. end
  1901. else
  1902. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  1903. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  1904. hit:breakJoints()
  1905. if hit.Anchored == false then
  1906. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1907. end
  1908. end
  1909. else
  1910. hit:breakJoints()
  1911. if hit.Anchored == false then
  1912. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  1913. end
  1914. end
  1915. end
  1916. end
  1917. if hit.Parent ~= nil then
  1918. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1919. if hit.Parent ~= script.Parent.Parent then
  1920. wait(0.5)
  1921. hit.Parent.Humanoid.PlatformStand = false
  1922. end
  1923. end
  1924. end
  1925. end
  1926. function remove(child)
  1927. child:Remove()
  1928. end
  1929. script.Parent.Touched:connect(ot)
  1930. script.Parent.ChildAdded:connect(remove)
  1931. end))
  1932. Motor6D81.Name = "RightElbow"
  1933. Motor6D81.Parent = mas
  1934. Motor6D81.C0 = CFrame.new(0.0145200128, -1.78210199, -0.0639328733, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1935. Motor6D81.C1 = CFrame.new(0.014524051, 0.832677782, -0.067019932, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1936. Motor6D81.Part0 = nil
  1937. Motor6D81.Part1 = nil
  1938. Attachment82.Name = "RightKneeRigAttachment"
  1939. Attachment82.Parent = mas
  1940. Attachment82.CFrame = CFrame.new(0.0259127542, 1.95905757, 0.000987773412, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1941. Attachment82.Position = Vector3.new(0.0259127542, 1.95905757, 0.000987773412)
  1942. Attachment83.Name = "RightAnkleRigAttachment"
  1943. Attachment83.Parent = mas
  1944. Attachment83.CFrame = CFrame.new(0.0259127542, -4.81339836, 0.00191943592, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1945. Attachment83.Position = Vector3.new(0.0259127542, -4.81339836, 0.00191943592)
  1946. Vector3Value84.Name = "OriginalSize"
  1947. Vector3Value84.Parent = mas
  1948. Vector3Value84.Value = Vector3.new(1.00027585, 1.48964536, 1.00032854)
  1949. Motor6D85.Name = "RightKnee"
  1950. Motor6D85.Parent = mas
  1951. Motor6D85.C0 = CFrame.new(0.0259127952, -1.7952857, 0.00289178547, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1952. Motor6D85.C1 = CFrame.new(0.0259127952, 1.95906019, 0.000987774343, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1953. Motor6D85.Part0 = nil
  1954. Motor6D85.Part1 = nil
  1955. Attachment86.Name = "RightShoulderRigAttachment"
  1956. Attachment86.Parent = mas
  1957. Attachment86.CFrame = CFrame.new(-1.67872632, 3.0941906, -0.063932769, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1958. Attachment86.Position = Vector3.new(-1.67872632, 3.0941906, -0.063932769)
  1959. Attachment87.Name = "RightElbowRigAttachment"
  1960. Attachment87.Parent = mas
  1961. Attachment87.CFrame = CFrame.new(0.0145199895, -1.78209805, -0.063932769, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1962. Attachment87.Position = Vector3.new(0.0145199895, -1.78209805, -0.063932769)
  1963. Attachment88.Name = "RightShoulderAttachment"
  1964. Attachment88.Parent = mas
  1965. Attachment88.CFrame = CFrame.new(0.0822436139, 4.80697584, -0.063932769, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1966. Attachment88.Position = Vector3.new(0.0822436139, 4.80697584, -0.063932769)
  1967. Vector3Value89.Name = "OriginalSize"
  1968. Vector3Value89.Parent = mas
  1969. Vector3Value89.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
  1970. Motor6D90.Name = "RightShoulder"
  1971. Motor6D90.Parent = mas
  1972. Motor6D90.C0 = CFrame.new(8.46773338, 3.76923919, -0.105385743, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1973. Motor6D90.C1 = CFrame.new(-1.67872834, 3.09419036, -0.0639328733, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1974. Motor6D90.Part0 = nil
  1975. Motor6D90.Part1 = nil
  1976. Attachment91.Name = "RightHipRigAttachment"
  1977. Attachment91.Parent = mas
  1978. Attachment91.CFrame = CFrame.new(0.0259127542, 3.28405571, 0.00329693686, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1979. Attachment91.Position = Vector3.new(0.0259127542, 3.28405571, 0.00329693686)
  1980. Attachment92.Name = "RightKneeRigAttachment"
  1981. Attachment92.Parent = mas
  1982. Attachment92.CFrame = CFrame.new(0.0259127542, -1.79528189, 0.00289178244, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1983. Attachment92.Position = Vector3.new(0.0259127542, -1.79528189, 0.00289178244)
  1984. Vector3Value93.Name = "OriginalSize"
  1985. Vector3Value93.Parent = mas
  1986. Vector3Value93.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  1987. Motor6D94.Name = "RightHip"
  1988. Motor6D94.Parent = mas
  1989. Motor6D94.C0 = CFrame.new(3.42063618, -1.64748406, 0.00696135359, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1990. Motor6D94.C1 = CFrame.new(0.0259127952, 3.28405929, 0.00329693779, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1991. Motor6D94.Part0 = nil
  1992. Motor6D94.Part1 = nil
  1993. IntValue95.Name = "Mode"
  1994. IntValue95.Parent = Model0
  1995. Humanoid96.Name = "NPC"
  1996. Humanoid96.Parent = Model0
  1997. Humanoid96.HealthDisplayDistance = 0
  1998. Humanoid96.NameDisplayDistance = 0
  1999. Humanoid96.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
  2000. Humanoid96.Torso = Part111
  2001. Humanoid96.Health = 15000
  2002. Humanoid96.MaxHealth = 15000
  2003. Humanoid96.WalkSpeed = 50
  2004. Attachment97.Name = "WaistRigAttachment"
  2005. Attachment97.Parent = mas
  2006. Attachment97.CFrame = CFrame.new(0.0022898165, -3.13878942, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2007. Attachment97.Position = Vector3.new(0.0022898165, -3.13878942, -0.105385698)
  2008. Attachment98.Name = "NeckRigAttachment"
  2009. Attachment98.Parent = mas
  2010. Attachment98.CFrame = CFrame.new(0.0022898165, 5.45881653, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2011. Attachment98.Position = Vector3.new(0.0022898165, 5.45881653, -0.105385698)
  2012. Attachment99.Name = "LeftShoulderRigAttachment"
  2013. Attachment99.Parent = mas
  2014. Attachment99.CFrame = CFrame.new(-8.46253681, 3.76824617, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2015. Attachment99.Position = Vector3.new(-8.46253681, 3.76824617, -0.105385698)
  2016. Attachment100.Name = "RightShoulderRigAttachment"
  2017. Attachment100.Parent = mas
  2018. Attachment100.CFrame = CFrame.new(8.46772766, 3.76923299, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2019. Attachment100.Position = Vector3.new(8.46772766, 3.76923299, -0.105385698)
  2020. Attachment101.Name = "LeftCollarAttachment"
  2021. Attachment101.Parent = mas
  2022. Attachment101.CFrame = CFrame.new(-6.77016306, 5.44707108, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2023. Attachment101.Position = Vector3.new(-6.77016306, 5.44707108, -0.105385698)
  2024. Attachment102.Name = "RightCollarAttachment"
  2025. Attachment102.Parent = mas
  2026. Attachment102.CFrame = CFrame.new(6.77474594, 5.44707108, -0.105385698, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2027. Attachment102.Position = Vector3.new(6.77474594, 5.44707108, -0.105385698)
  2028. Attachment103.Name = "BodyBackAttachment"
  2029. Attachment103.Parent = mas
  2030. Attachment103.CFrame = CFrame.new(0.0022898165, -1.51754165, 3.54321289, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2031. Attachment103.Position = Vector3.new(0.0022898165, -1.51754165, 3.54321289)
  2032. Attachment104.Name = "BodyFrontAttachment"
  2033. Attachment104.Parent = mas
  2034. Attachment104.CFrame = CFrame.new(0.0022898165, -1.51754165, -3.3772428, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2035. Attachment104.Position = Vector3.new(0.0022898165, -1.51754165, -3.3772428)
  2036. Vector3Value105.Name = "OriginalSize"
  2037. Vector3Value105.Parent = mas
  2038. Vector3Value105.Value = Vector3.new(2.00029206, 1.60093355, 1.0005368)
  2039. Script106.Name = "Damage Script"
  2040. Script106.Parent = mas
  2041. table.insert(cors,sandbox(Script106,function()
  2042. function onTouched(hit)
  2043. local human = hit.Parent:findFirstChild("Humanoid")
  2044. if (human ~= nil) then
  2045. human.Health = human.Health - 5 -- Change the amount to change the damage.
  2046. end
  2047. end
  2048. script.Parent.Touched:connect(onTouched)
  2049. end))
  2050. Script107.Name = "Hurting"
  2051. Script107.Parent = mas
  2052. table.insert(cors,sandbox(Script107,function()
  2053. function onTouched(hit)
  2054. local humanoid = hit.Parent:findFirstChild("Humanoid")
  2055. if (humanoid ~= nil) then
  2056. humanoid.Health = humanoid.Health - 25
  2057. end
  2058. end
  2059.  
  2060. script.Parent.Touched:connect(onTouched)
  2061. end))
  2062. Script108.Name = "ShieldScript"
  2063. Script108.Parent = mas
  2064. table.insert(cors,sandbox(Script108,function()
  2065. function ot(hit)
  2066. ch = hit:GetChildren()
  2067. for i = 1, #ch do
  2068. if ch[i].className == "BodyVelocity" then
  2069. ch[i].velocity = ch[i].velocity*-1
  2070. end
  2071. end
  2072. if hit.Parent ~= nil then
  2073. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2074. if hit.Parent ~= script.Parent.Parent then
  2075. if hit.Parent:FindFirstChild("Torso") ~= nil then
  2076. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2077. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2078. end
  2079. hit.Parent.Humanoid.PlatformStand = true
  2080. end
  2081. else
  2082. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  2083. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  2084. hit:breakJoints()
  2085. if hit.Anchored == false then
  2086. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2087. end
  2088. end
  2089. else
  2090. hit:breakJoints()
  2091. if hit.Anchored == false then
  2092. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2093. end
  2094. end
  2095. end
  2096. end
  2097. if hit.Parent ~= nil then
  2098. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2099. if hit.Parent ~= script.Parent.Parent then
  2100. wait(0.5)
  2101. hit.Parent.Humanoid.PlatformStand = false
  2102. end
  2103. end
  2104. end
  2105. end
  2106. function remove(child)
  2107. child:Remove()
  2108. end
  2109. script.Parent.Touched:connect(ot)
  2110. script.Parent.ChildAdded:connect(remove)
  2111. end))
  2112. Motor6D109.Name = "Waist"
  2113. Motor6D109.Parent = mas
  2114. Motor6D109.C0 = CFrame.new(0.00189745135, 3.63778567, -0.0966572911, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2115. Motor6D109.C1 = CFrame.new(0.0022898186, -3.13879156, -0.105385743, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2116. Motor6D109.Part0 = nil
  2117. Motor6D109.Part1 = nil
  2118. Script110.Name = "Read me"
  2119. Script110.Parent = Model0
  2120. table.insert(cors,sandbox(Script110,function()
  2121. --| Help for R15 model Zombie |--
  2122. --
  2123. -- To edit the zombie's damage go to LeftLowerArm/RightLowerArm > Damage Script > human.Health = human.Health - 5
  2124. -- Edit the number to whatever you'd like
  2125. -- The player will recieve damage from the LeftLowerArm and RightLowerArm
  2126. -- To edit the walkspeed go to Humanoid > Scroll to the bottom > Edit the number shown after WalkSpeed
  2127. -- You can also edit max health and spawn health under Humanoid > game
  2128. --
  2129. -- Have fun!
  2130. --
  2131. -- ImFarAway
  2132. end))
  2133. Part111.Name = "HumanoidRootPart"
  2134. Part111.Parent = Model0
  2135. Part111.Material = Enum.Material.Metal
  2136. Part111.BrickColor = BrickColor.new("Really black")
  2137. Part111.Transparency = 1
  2138. Part111.Rotation = Vector3.new(-2.30999994, -89.9599991, -2.30999994)
  2139. Part111.CanCollide = false
  2140. Part111.Size = Vector3.new(13.5449219, 13.5449219, 6.77246094)
  2141. Part111.CFrame = CFrame.new(-74.7772369, 15.8801241, 47.5431213, 0.000767999853, 3.10000432e-05, -0.999999762, -1.899981e-05, 1, 3.09854622e-05, 0.999999762, 1.89760049e-05, 0.000768000435)
  2142. Part111.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2143. Part111.Position = Vector3.new(-74.7772369, 15.8801241, 47.5431213)
  2144. Part111.Orientation = Vector3.new(0, -89.9599991, 0)
  2145. Part111.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2146. Attachment112.Name = "RootRigAttachment"
  2147. Attachment112.Parent = Part111
  2148. Vector3Value113.Name = "OriginalSize"
  2149. Vector3Value113.Parent = Part111
  2150. Vector3Value113.Value = Vector3.new(2, 2, 1)
  2151. Script114.Name = "ShieldScript"
  2152. Script114.Parent = Part111
  2153. table.insert(cors,sandbox(Script114,function()
  2154. function ot(hit)
  2155. ch = hit:GetChildren()
  2156. for i = 1, #ch do
  2157. if ch[i].className == "BodyVelocity" then
  2158. ch[i].velocity = ch[i].velocity*-1
  2159. end
  2160. end
  2161. if hit.Parent ~= nil then
  2162. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2163. if hit.Parent ~= script.Parent.Parent then
  2164. if hit.Parent:FindFirstChild("Torso") ~= nil then
  2165. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2166. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2167. end
  2168. hit.Parent.Humanoid.PlatformStand = true
  2169. end
  2170. else
  2171. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  2172. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  2173. hit:breakJoints()
  2174. if hit.Anchored == false then
  2175. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2176. end
  2177. end
  2178. else
  2179. hit:breakJoints()
  2180. if hit.Anchored == false then
  2181. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2182. end
  2183. end
  2184. end
  2185. end
  2186. if hit.Parent ~= nil then
  2187. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2188. if hit.Parent ~= script.Parent.Parent then
  2189. wait(0.5)
  2190. hit.Parent.Humanoid.PlatformStand = false
  2191. end
  2192. end
  2193. end
  2194. end
  2195. function remove(child)
  2196. child:Remove()
  2197. end
  2198. script.Parent.Touched:connect(ot)
  2199. script.Parent.ChildAdded:connect(remove)
  2200. end))
  2201. Script115.Name = "Hurting"
  2202. Script115.Parent = Part111
  2203. table.insert(cors,sandbox(Script115,function()
  2204. function onTouched(hit)
  2205. local humanoid = hit.Parent:findFirstChild("Humanoid")
  2206. if (humanoid ~= nil) then
  2207. humanoid.Health = humanoid.Health - 25
  2208. end
  2209. end
  2210.  
  2211. script.Parent.Touched:connect(onTouched)
  2212. end))
  2213. Part116.Name = "Scary Popup"
  2214. Part116.Parent = Part111
  2215. Part116.BrickColor = BrickColor.new("Dark stone grey")
  2216. Part116.Transparency = 1
  2217. Part116.Rotation = Vector3.new(0, -90, 0)
  2218. Part116.Anchored = true
  2219. Part116.CanCollide = false
  2220. Part116.FormFactor = Enum.FormFactor.Custom
  2221. Part116.Size = Vector3.new(13.8900099, 25.7999935, 2.60000205)
  2222. Part116.CFrame = CFrame.new(-72.9161987, 13.046526, 47.8049393, 1.29568446e-06, -5.98956831e-08, -1, -8.26474028e-11, 1, -5.98956831e-08, 1, 8.27249935e-11, 1.29568446e-06)
  2223. Part116.Color = Color3.new(0.388235, 0.372549, 0.384314)
  2224. Part116.Position = Vector3.new(-72.9161987, 13.046526, 47.8049393)
  2225. Part116.Orientation = Vector3.new(0, -90, 0)
  2226. Part116.Color = Color3.new(0.388235, 0.372549, 0.384314)
  2227. Script117.Name = "ScaryScript"
  2228. Script117.Parent = Part116
  2229. table.insert(cors,sandbox(Script117,function()
  2230. Sound = script.Parent.Scream
  2231. Popup = script.Parent.Popup
  2232. Ready = true
  2233. function onTouch(hit)
  2234. local h = hit.Parent:FindFirstChild("Humanoid")
  2235. if h ~= nil and Ready == true then
  2236. Ready = false
  2237. local plyr = game.Players:FindFirstChild(h.Parent.Name)
  2238. local c = Popup:clone()
  2239. c.Parent = plyr.PlayerGui
  2240. script.Parent.Scream:play()
  2241. wait(7)
  2242. c:remove()
  2243. wait(1)
  2244. Ready = true
  2245. end
  2246. end
  2247.  
  2248. script.Parent.Touched:connect(onTouch)
  2249.  
  2250. end))
  2251. ScreenGui118.Name = "Popup"
  2252. ScreenGui118.Parent = Part116
  2253. Frame119.Name = "BackGround"
  2254. Frame119.Parent = ScreenGui118
  2255. Frame119.Transparency = 1
  2256. Frame119.Size = UDim2.new(1, 1, 1, 1)
  2257. Frame119.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  2258. Frame119.BackgroundTransparency = 1
  2259. ImageLabel120.Name = "Image"
  2260. ImageLabel120.Parent = Frame119
  2261. ImageLabel120.Transparency = 1
  2262. ImageLabel120.Size = UDim2.new(1, 1, 1, 1)
  2263. ImageLabel120.BackgroundColor3 = Color3.new(0, 0, 0)
  2264. ImageLabel120.BackgroundTransparency = 1
  2265. ImageLabel120.ImageTransparency = 1
  2266. Sound121.Name = "Scream"
  2267. Sound121.Parent = Part116
  2268. Sound121.SoundId = "rbxassetid://130767645"
  2269. Sound121.TimePosition = 0.3
  2270. Sound121.Volume = 10
  2271. Script122.Name = "qPerfectionWeld"
  2272. Script122.Parent = Part111
  2273. table.insert(cors,sandbox(Script122,function()
  2274. -- Created by Quenty (@Quenty, follow me on twitter).
  2275. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  2276. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  2277.  
  2278. --[[ INSTRUCTIONS
  2279. - Place in the model
  2280. - Make sure model is anchored
  2281. - That's it. It will weld the model and all children.
  2282.  
  2283. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2284. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2285. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2286. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2287. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2288. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2289. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2290. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  2291.  
  2292. 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.
  2293. ]]
  2294.  
  2295. --[[ DOCUMENTATION
  2296. - 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.
  2297. - Will work in PBS servers
  2298. - Will work as long as it starts out with the part anchored
  2299. - Stores the relative CFrame as a CFrame value
  2300. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  2301. - Utilizes a recursive algorith to find all parts in the model
  2302. - Will reweld on script reparent if the script is initially parented to a tool.
  2303. - Welds as fast as possible
  2304. ]]
  2305.  
  2306. -- qPerfectionWeld.lua
  2307. -- Created 10/6/2014
  2308. -- Author: Quenty
  2309. -- Version 1.0.3
  2310.  
  2311. -- Updated 10/14/2014 - Updated to 1.0.1
  2312. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  2313.  
  2314. -- Updated 10/14/2014 - Updated to 1.0.2
  2315. --- Fixed bug fix.
  2316.  
  2317. -- Updated 10/14/2014 - Updated to 1.0.3
  2318. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  2319.  
  2320. 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).
  2321.  
  2322.  
  2323. local function CallOnChildren(Instance, FunctionToCall)
  2324. -- Calls a function on each of the children of a certain object, using recursion.
  2325.  
  2326. FunctionToCall(Instance)
  2327.  
  2328. for _, Child in next, Instance:GetChildren() do
  2329. CallOnChildren(Child, FunctionToCall)
  2330. end
  2331. end
  2332.  
  2333. local function GetNearestParent(Instance, ClassName)
  2334. -- Returns the nearest parent of a certain class, or returns nil
  2335.  
  2336. local Ancestor = Instance
  2337. repeat
  2338. Ancestor = Ancestor.Parent
  2339. if Ancestor == nil then
  2340. return nil
  2341. end
  2342. until Ancestor:IsA(ClassName)
  2343.  
  2344. return Ancestor
  2345. end
  2346.  
  2347. local function GetBricks(StartInstance)
  2348. local List = {}
  2349.  
  2350. -- if StartInstance:IsA("BasePart") then
  2351. -- List[#List+1] = StartInstance
  2352. -- end
  2353.  
  2354. CallOnChildren(StartInstance, function(Item)
  2355. if Item:IsA("BasePart") then
  2356. List[#List+1] = Item;
  2357. end
  2358. end)
  2359.  
  2360. return List
  2361. end
  2362.  
  2363. local function Modify(Instance, Values)
  2364. -- Modifies an Instance by using a table.
  2365.  
  2366. assert(type(Values) == "table", "Values is not a table");
  2367.  
  2368. for Index, Value in next, Values do
  2369. if type(Index) == "number" then
  2370. Value.Parent = Instance
  2371. else
  2372. Instance[Index] = Value
  2373. end
  2374. end
  2375. return Instance
  2376. end
  2377.  
  2378. local function Make(ClassType, Properties)
  2379. -- Using a syntax hack to create a nice way to Make new items.
  2380.  
  2381. return Modify(Instance.new(ClassType), Properties)
  2382. end
  2383.  
  2384. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  2385. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  2386.  
  2387. local function HasWheelJoint(Part)
  2388. for _, SurfaceName in pairs(Surfaces) do
  2389. for _, HingSurfaceName in pairs(HingSurfaces) do
  2390. if Part[SurfaceName].Name == HingSurfaceName then
  2391. return true
  2392. end
  2393. end
  2394. end
  2395.  
  2396. return false
  2397. end
  2398.  
  2399. local function ShouldBreakJoints(Part)
  2400. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  2401. -- definitely some edge cases.
  2402.  
  2403. if NEVER_BREAK_JOINTS then
  2404. return false
  2405. end
  2406.  
  2407. if HasWheelJoint(Part) then
  2408. return false
  2409. end
  2410.  
  2411. local Connected = Part:GetConnectedParts()
  2412.  
  2413. if #Connected == 1 then
  2414. return false
  2415. end
  2416.  
  2417. for _, Item in pairs(Connected) do
  2418. if HasWheelJoint(Item) then
  2419. return false
  2420. elseif not Item:IsDescendantOf(script.Parent) then
  2421. return false
  2422. end
  2423. end
  2424.  
  2425. return true
  2426. end
  2427.  
  2428. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  2429. --- Weld's 2 parts together
  2430. -- @param Part0 The first part
  2431. -- @param Part1 The second part (Dependent part most of the time).
  2432. -- @param [JointType] The type of joint. Defaults to weld.
  2433. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  2434. -- @return The weld created.
  2435.  
  2436. JointType = JointType or "Weld"
  2437. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  2438.  
  2439. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  2440. Modify(NewWeld, {
  2441. Name = "qCFrameWeldThingy";
  2442. Part0 = Part0;
  2443. Part1 = Part1;
  2444. C0 = CFrame.new();--Part0.CFrame:inverse();
  2445. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  2446. Parent = Part1;
  2447. })
  2448.  
  2449. if not RelativeValue then
  2450. RelativeValue = Make("CFrameValue", {
  2451. Parent = Part1;
  2452. Name = "qRelativeCFrameWeldValue";
  2453. Archivable = true;
  2454. Value = NewWeld.C1;
  2455. })
  2456. end
  2457.  
  2458. return NewWeld
  2459. end
  2460.  
  2461. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  2462. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  2463. -- @param MainPart The part to weld the model to (can be in the model).
  2464. -- @param [JointType] The type of joint. Defaults to weld.
  2465. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  2466.  
  2467. for _, Part in pairs(Parts) do
  2468. if ShouldBreakJoints(Part) then
  2469. Part:BreakJoints()
  2470. end
  2471. end
  2472.  
  2473. for _, Part in pairs(Parts) do
  2474. if Part ~= MainPart then
  2475. WeldTogether(MainPart, Part, JointType, MainPart)
  2476. end
  2477. end
  2478.  
  2479. if not DoNotUnanchor then
  2480. for _, Part in pairs(Parts) do
  2481. Part.Anchored = false
  2482. end
  2483. MainPart.Anchored = false
  2484. end
  2485. end
  2486.  
  2487. local function PerfectionWeld()
  2488. local Tool = GetNearestParent(script, "Tool")
  2489.  
  2490. local Parts = GetBricks(script.Parent)
  2491. 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]
  2492.  
  2493. if PrimaryPart then
  2494. WeldParts(Parts, PrimaryPart, "Weld", false)
  2495. else
  2496. warn("qWeld - Unable to weld part")
  2497. end
  2498.  
  2499. return Tool
  2500. end
  2501.  
  2502. local Tool = PerfectionWeld()
  2503.  
  2504.  
  2505. if Tool and script.ClassName == "Script" then
  2506. --- Don't bother with local scripts
  2507.  
  2508. script.Parent.AncestryChanged:connect(function()
  2509. PerfectionWeld()
  2510. end)
  2511. end
  2512.  
  2513. -- Created by Quenty (@Quenty, follow me on twitter).
  2514.  
  2515. end))
  2516. Part123.Name = "Head"
  2517. Part123.Parent = Model0
  2518. Part123.Material = Enum.Material.Metal
  2519. Part123.BrickColor = BrickColor.new("Really black")
  2520. Part123.Rotation = Vector3.new(-2.30999994, -89.9599991, -2.30999994)
  2521. Part123.FormFactor = Enum.FormFactor.Custom
  2522. Part123.Size = Vector3.new(6.77246094, 6.77246094, 6.77246094)
  2523. Part123.CFrame = CFrame.new(-74.7505798, 31.0451355, 47.5435753, 0.000767999853, 3.10000432e-05, -0.999999762, -1.899981e-05, 1, 3.09854622e-05, 0.999999762, 1.89760049e-05, 0.000768000435)
  2524. Part123.BottomSurface = Enum.SurfaceType.Smooth
  2525. Part123.TopSurface = Enum.SurfaceType.Smooth
  2526. Part123.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2527. Part123.Position = Vector3.new(-74.7505798, 31.0451355, 47.5435753)
  2528. Part123.Orientation = Vector3.new(0, -89.9599991, 0)
  2529. Part123.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  2530. Attachment124.Name = "FaceCenterAttachment"
  2531. Attachment124.Parent = Part123
  2532. Attachment124.Rotation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2533. Attachment124.CFrame = CFrame.new(2.01834766e-07, 0.00260447734, 0.0261880569, 1, 1.6054104e-16, -1.21432539e-15, -1.6054104e-16, 1, 6.9388939e-17, 1.21432539e-15, -6.9388939e-17, 1)
  2534. Attachment124.Position = Vector3.new(2.01834766e-07, 0.00260447734, 0.0261880569)
  2535. Attachment124.Axis = Vector3.new(1, -1.6054104e-16, 1.21432539e-15)
  2536. Attachment124.Orientation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2537. Attachment125.Name = "NeckRigAttachment"
  2538. Attachment125.Parent = Part123
  2539. Attachment125.CFrame = CFrame.new(-0.000184275297, -3.83060598, 0.0261880606, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2540. Attachment125.Position = Vector3.new(-0.000184275297, -3.83060598, 0.0261880606)
  2541. Attachment126.Name = "FaceFrontAttachment"
  2542. Attachment126.Parent = Part123
  2543. Attachment126.Rotation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2544. Attachment126.CFrame = CFrame.new(1.16045182e-08, 0.000342312007, -4.01863289, 1, 1.6054104e-16, -1.21432539e-15, -1.6054104e-16, 1, 6.9388939e-17, 1.21432539e-15, -6.9388939e-17, 1)
  2545. Attachment126.Position = Vector3.new(1.16045182e-08, 0.000342312007, -4.01863289)
  2546. Attachment126.Axis = Vector3.new(1, -1.6054104e-16, 1.21432539e-15)
  2547. Attachment126.Orientation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2548. Attachment127.Name = "HairAttachment"
  2549. Attachment127.Parent = Part123
  2550. Attachment127.Rotation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2551. Attachment127.CFrame = CFrame.new(1.16045182e-08, 4.057549, 0.0261880681, 1, 1.6054104e-16, -1.21432539e-15, -1.6054104e-16, 1, 6.9388939e-17, 1.21432539e-15, -6.9388939e-17, 1)
  2552. Attachment127.Position = Vector3.new(1.16045182e-08, 4.057549, 0.0261880681)
  2553. Attachment127.Axis = Vector3.new(1, -1.6054104e-16, 1.21432539e-15)
  2554. Attachment127.Orientation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2555. Attachment128.Name = "HatAttachment"
  2556. Attachment128.Parent = Part123
  2557. Attachment128.Rotation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2558. Attachment128.CFrame = CFrame.new(1.16045182e-08, 4.057549, 0.0261880681, 1, 1.6054104e-16, -1.21432539e-15, -1.6054104e-16, 1, 6.9388939e-17, 1.21432539e-15, -6.9388939e-17, 1)
  2559. Attachment128.Position = Vector3.new(1.16045182e-08, 4.057549, 0.0261880681)
  2560. Attachment128.Axis = Vector3.new(1, -1.6054104e-16, 1.21432539e-15)
  2561. Attachment128.Orientation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2562. Attachment129.Name = "NeckAttachment"
  2563. Attachment129.Parent = Part123
  2564. Attachment129.Rotation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2565. Attachment129.CFrame = CFrame.new(-0.000184275297, -3.91128731, 0.0261880606, 1, 1.6054104e-16, -1.21432539e-15, -1.6054104e-16, 1, 6.9388939e-17, 1.21432539e-15, -6.9388939e-17, 1)
  2566. Attachment129.Position = Vector3.new(-0.000184275297, -3.91128731, 0.0261880606)
  2567. Attachment129.Axis = Vector3.new(1, -1.6054104e-16, 1.21432539e-15)
  2568. Attachment129.Orientation = Vector3.new(-3.97569356e-15, -6.957572e-14, -9.1983238e-15)
  2569. Vector3Value130.Name = "OriginalSize"
  2570. Vector3Value130.Parent = Part123
  2571. Vector3Value130.Value = Vector3.new(1, 1, 1)
  2572. Script131.Name = "ShieldScript"
  2573. Script131.Parent = Part123
  2574. table.insert(cors,sandbox(Script131,function()
  2575. function ot(hit)
  2576. ch = hit:GetChildren()
  2577. for i = 1, #ch do
  2578. if ch[i].className == "BodyVelocity" then
  2579. ch[i].velocity = ch[i].velocity*-1
  2580. end
  2581. end
  2582. if hit.Parent ~= nil then
  2583. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2584. if hit.Parent ~= script.Parent.Parent then
  2585. if hit.Parent:FindFirstChild("Torso") ~= nil then
  2586. hit.Parent.Torso.Velocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2587. hit.Parent.Torso.RotVelocity = (hit.Parent.Torso.Position - script.Parent.Position)*5
  2588. end
  2589. hit.Parent.Humanoid.PlatformStand = true
  2590. end
  2591. else
  2592. if hit.Parent.className == "Model" or hit.Parent.className == "Hat" then
  2593. if hit.Parent.Parent:FindFirstChild("Humanoid") == nil then
  2594. hit:breakJoints()
  2595. if hit.Anchored == false then
  2596. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2597. end
  2598. end
  2599. else
  2600. hit:breakJoints()
  2601. if hit.Anchored == false then
  2602. hit.Velocity = hit.Velocity*-1 + ((hit.Position - script.Parent.Position)*1000)/hit:GetMass()
  2603. end
  2604. end
  2605. end
  2606. end
  2607. if hit.Parent ~= nil then
  2608. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  2609. if hit.Parent ~= script.Parent.Parent then
  2610. wait(0.5)
  2611. hit.Parent.Humanoid.PlatformStand = false
  2612. end
  2613. end
  2614. end
  2615. end
  2616. function remove(child)
  2617. child:Remove()
  2618. end
  2619. script.Parent.Touched:connect(ot)
  2620. script.Parent.ChildAdded:connect(remove)
  2621. end))
  2622. Script132.Name = "Hurting"
  2623. Script132.Parent = Part123
  2624. table.insert(cors,sandbox(Script132,function()
  2625. function onTouched(hit)
  2626. local humanoid = hit.Parent:findFirstChild("Humanoid")
  2627. if (humanoid ~= nil) then
  2628. humanoid.Health = humanoid.Health - 25
  2629. end
  2630. end
  2631.  
  2632. script.Parent.Touched:connect(onTouched)
  2633. end))
  2634. Motor6D133.Name = "Neck"
  2635. Motor6D133.Parent = Part123
  2636. Motor6D133.C0 = CFrame.new(0.0022898186, 5.4588213, -0.105385743, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2637. Motor6D133.C1 = CFrame.new(-0.000184275414, -3.83060861, 0.026188096, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  2638. Motor6D133.Part0 = nil
  2639. Motor6D133.Part1 = Part123
  2640. Sound134.Parent = Part123
  2641. Sound134.SoundId = "rbxassetid://449830565"
  2642. Sound134.Volume = 4
  2643. Sound135.Parent = Part123
  2644. Sound135.SoundId = "rbxassetid://132874183"
  2645. Sound135.Volume = 4
  2646. Sound135.Looped = true
  2647. SpecialMesh136.Parent = Part123
  2648. SpecialMesh136.MeshId = "http://www.roblox.com/asset/?id=19999257"
  2649. SpecialMesh136.Scale = Vector3.new(6.03900242, 5.49000359, 5.79500103)
  2650. SpecialMesh136.TextureId = "http://www.roblox.com/asset/?id=205502594"
  2651. SpecialMesh136.MeshType = Enum.MeshType.FileMesh
  2652. SpecialMesh136.Scale = Vector3.new(6.03900242, 5.49000359, 5.79500103)
  2653. Script137.Name = "Sound"
  2654. Script137.Parent = Model0
  2655. table.insert(cors,sandbox(Script137,function()
  2656. --[[
  2657. Author: @spotco
  2658. This script creates sounds which are placed under the character head.
  2659. These sounds are used by the "LocalSound" script.
  2660.  
  2661. To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  2662. The default Sound script loaded for every character will then be replaced with your copy of the script.
  2663. ]]--
  2664.  
  2665. function CreateNewSound(name, id, looped, pitch, parent)
  2666. local sound = Instance.new("Sound")
  2667. sound.SoundId = id
  2668. sound.Name = name
  2669. sound.archivable = false
  2670. sound.Parent = parent
  2671. sound.Pitch = pitch
  2672. sound.Looped = looped
  2673.  
  2674. sound.MinDistance = 5
  2675. sound.MaxDistance = 150
  2676. sound.Volume = 0.65
  2677.  
  2678. return sound
  2679. end
  2680.  
  2681. local head = script.Parent:FindFirstChild("Head")
  2682. if head == nil then
  2683. error("Sound script parent has no child Head.")
  2684. return
  2685. end
  2686.  
  2687.  
  2688. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  2689. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  2690. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  2691. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  2692. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  2693. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  2694. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  2695. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  2696. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  2697. end))
  2698. Script138.Name = "LocalSound"
  2699. Script138.Parent = Script137
  2700. table.insert(cors,sandbox(Script138,function()
  2701. --[[
  2702. Author: @spotco
  2703. This script runs locally for the player of the given humanoid.
  2704. This script triggers humanoid sound play/pause actions locally.
  2705.  
  2706. The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  2707. immediately for the player and is replicated to all other players.
  2708.  
  2709. This script is optimized to reduce network traffic through minimizing the amount of property replication.
  2710. ]]--
  2711.  
  2712. --All sounds are referenced by this ID
  2713. local SFX = {
  2714. Died = 0;
  2715. Running = 1;
  2716. Swimming = 2;
  2717. Climbing = 3,
  2718. Jumping = 4;
  2719. GettingUp = 5;
  2720. FreeFalling = 6;
  2721. FallingDown = 7;
  2722. Landing = 8;
  2723. Splash = 9;
  2724. }
  2725.  
  2726. local Humanoid = nil
  2727. local Head = nil
  2728.  
  2729. --SFX ID to Sound object
  2730. local Sounds = {}
  2731.  
  2732. do
  2733. local Figure = script.Parent.Parent
  2734. Head = Figure:WaitForChild("Head")
  2735. while not Humanoid do
  2736. for _,NewHumanoid in pairs(Figure:GetChildren()) do
  2737. if NewHumanoid:IsA("Humanoid") then
  2738. Humanoid = NewHumanoid
  2739. break
  2740. end
  2741. end
  2742. Figure.ChildAdded:wait()
  2743. end
  2744.  
  2745. Sounds[SFX.Died] = Head:WaitForChild("Died")
  2746. Sounds[SFX.Running] = Head:WaitForChild("Running")
  2747. Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
  2748. Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
  2749. Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
  2750. Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
  2751. Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
  2752. Sounds[SFX.Landing] = Head:WaitForChild("Landing")
  2753. Sounds[SFX.Splash] = Head:WaitForChild("Splash")
  2754. end
  2755.  
  2756. local Util
  2757. Util = {
  2758.  
  2759. --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  2760. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  2761. --(y - y1)/(x - x1) = m
  2762. local m = (pt1y - pt2y) / (pt1x - pt2x)
  2763. --float b = pt1.y - m * pt1.x;
  2764. local b = (pt1y - m * pt1x)
  2765. return m * x + b
  2766. end;
  2767.  
  2768. --Clamps the value of "val" between the "min" and "max"
  2769. Clamp = function(val,min,max)
  2770. return math.min(max,math.max(min,val))
  2771. end;
  2772.  
  2773. --Gets the horizontal (x,z) velocity magnitude of the given part
  2774. HorizontalSpeed = function(Head)
  2775. local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  2776. return hVel.magnitude
  2777. end;
  2778.  
  2779. --Gets the vertical (y) velocity magnitude of the given part
  2780. VerticalSpeed = function(Head)
  2781. return math.abs(Head.Velocity.Y)
  2782. end;
  2783.  
  2784. --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  2785. --If these properties are enabled, use them.
  2786. Play = function(sound)
  2787. if sound.TimePosition ~= 0 then
  2788. sound.TimePosition = 0
  2789. end
  2790. if not sound.IsPlaying then
  2791. sound.Playing = true
  2792. end
  2793. end;
  2794. Pause = function(sound)
  2795. if sound.IsPlaying then
  2796. sound.Playing = false
  2797. end
  2798. end;
  2799. Resume = function(sound)
  2800. if not sound.IsPlaying then
  2801. sound.Playing = true
  2802. end
  2803. end;
  2804. Stop = function(sound)
  2805. if sound.IsPlaying then
  2806. sound.Playing = false
  2807. end
  2808. if sound.TimePosition ~= 0 then
  2809. sound.TimePosition = 0
  2810. end
  2811. end;
  2812. }
  2813.  
  2814. do
  2815. -- List of all active Looped sounds
  2816. local playingLoopedSounds = {}
  2817.  
  2818. -- Last seen Enum.HumanoidStateType
  2819. local activeState = nil
  2820.  
  2821. -- Verify and set that "sound" is in "playingLoopedSounds".
  2822. function setSoundInPlayingLoopedSounds(sound)
  2823. for i=1, #playingLoopedSounds do
  2824. if playingLoopedSounds[i] == sound then
  2825. return
  2826. end
  2827. end
  2828. table.insert(playingLoopedSounds,sound)
  2829. end
  2830.  
  2831. -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  2832. function stopPlayingLoopedSoundsExcept(except)
  2833. for i=#playingLoopedSounds,1,-1 do
  2834. if playingLoopedSounds[i] ~= except then
  2835. Util.Pause(playingLoopedSounds[i])
  2836. table.remove(playingLoopedSounds,i)
  2837. end
  2838. end
  2839. end
  2840.  
  2841. -- Table of Enum.HumanoidStateType to handling function
  2842. local stateUpdateHandler = {
  2843. [Enum.HumanoidStateType.Dead] = function()
  2844. stopPlayingLoopedSoundsExcept()
  2845. local sound = Sounds[SFX.Died]
  2846. Util.Play(sound)
  2847. end;
  2848.  
  2849. [Enum.HumanoidStateType.RunningNoPhysics] = function()
  2850. stateUpdated(Enum.HumanoidStateType.Running)
  2851. end;
  2852.  
  2853. [Enum.HumanoidStateType.Running] = function()
  2854. local sound = Sounds[SFX.Running]
  2855. stopPlayingLoopedSoundsExcept(sound)
  2856.  
  2857. if Util.HorizontalSpeed(Head) > 0.5 then
  2858. Util.Resume(sound)
  2859. setSoundInPlayingLoopedSounds(sound)
  2860. else
  2861. stopPlayingLoopedSoundsExcept()
  2862. end
  2863. end;
  2864.  
  2865. [Enum.HumanoidStateType.Swimming] = function()
  2866. if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalSpeed(Head) > 0.1 then
  2867. local splashSound = Sounds[SFX.Splash]
  2868. splashSound.Volume = Util.Clamp(
  2869. Util.YForLineGivenXAndTwoPts(
  2870. Util.VerticalSpeed(Head),
  2871. 100, 0.28,
  2872. 350, 1),
  2873. 0,1)
  2874. Util.Play(splashSound)
  2875. end
  2876.  
  2877. do
  2878. local sound = Sounds[SFX.Swimming]
  2879. stopPlayingLoopedSoundsExcept(sound)
  2880. Util.Resume(sound)
  2881. setSoundInPlayingLoopedSounds(sound)
  2882. end
  2883. end;
  2884.  
  2885. [Enum.HumanoidStateType.Climbing] = function()
  2886. local sound = Sounds[SFX.Climbing]
  2887. if Util.VerticalSpeed(Head) > 0.1 then
  2888. Util.Resume(sound)
  2889. stopPlayingLoopedSoundsExcept(sound)
  2890. else
  2891. stopPlayingLoopedSoundsExcept()
  2892. end
  2893. setSoundInPlayingLoopedSounds(sound)
  2894. end;
  2895.  
  2896. [Enum.HumanoidStateType.Jumping] = function()
  2897. if activeState == Enum.HumanoidStateType.Jumping then
  2898. return
  2899. end
  2900. stopPlayingLoopedSoundsExcept()
  2901. local sound = Sounds[SFX.Jumping]
  2902. Util.Play(sound)
  2903. end;
  2904.  
  2905. [Enum.HumanoidStateType.GettingUp] = function()
  2906. stopPlayingLoopedSoundsExcept()
  2907. local sound = Sounds[SFX.GettingUp]
  2908. Util.Play(sound)
  2909. end;
  2910.  
  2911. [Enum.HumanoidStateType.Freefall] = function()
  2912. if activeState == Enum.HumanoidStateType.Freefall then
  2913. return
  2914. end
  2915. local sound = Sounds[SFX.FreeFalling]
  2916. sound.Volume = 0
  2917. stopPlayingLoopedSoundsExcept()
  2918. end;
  2919.  
  2920. [Enum.HumanoidStateType.FallingDown] = function()
  2921. stopPlayingLoopedSoundsExcept()
  2922. end;
  2923.  
  2924. [Enum.HumanoidStateType.Landed] = function()
  2925. stopPlayingLoopedSoundsExcept()
  2926. if Util.VerticalSpeed(Head) > 75 then
  2927. local landingSound = Sounds[SFX.Landing]
  2928. landingSound.Volume = Util.Clamp(
  2929. Util.YForLineGivenXAndTwoPts(
  2930. Util.VerticalSpeed(Head),
  2931. 50, 0,
  2932. 100, 1),
  2933. 0,1)
  2934. Util.Play(landingSound)
  2935. end
  2936. end
  2937. }
  2938.  
  2939. -- Handle state event fired or OnChange fired
  2940. function stateUpdated(state)
  2941. if stateUpdateHandler[state] ~= nil then
  2942. stateUpdateHandler[state]()
  2943. end
  2944. activeState = state
  2945. end
  2946.  
  2947. Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
  2948. Humanoid.Running:connect( function() stateUpdated(Enum.HumanoidStateType.Running) end)
  2949. Humanoid.Swimming:connect( function() stateUpdated(Enum.HumanoidStateType.Swimming) end)
  2950. Humanoid.Climbing:connect( function() stateUpdated(Enum.HumanoidStateType.Climbing) end)
  2951. Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
  2952. Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
  2953. Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
  2954. Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
  2955.  
  2956. -- required for proper handling of Landed event
  2957. Humanoid.StateChanged:connect(function(old, new)
  2958. stateUpdated(new)
  2959. end)
  2960.  
  2961.  
  2962. function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  2963. local stepScale = stepDeltaSeconds / tickSpeedSeconds
  2964. do
  2965. local sound = Sounds[SFX.FreeFalling]
  2966. if activeState == Enum.HumanoidStateType.Freefall then
  2967. if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  2968. Util.Resume(sound)
  2969.  
  2970. --Volume takes 1.1 seconds to go from volume 0 to 1
  2971. local ANIMATION_LENGTH_SECONDS = 1.1
  2972.  
  2973. local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
  2974. sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  2975. else
  2976. sound.Volume = 0
  2977. end
  2978. else
  2979. Util.Pause(sound)
  2980. end
  2981. end
  2982.  
  2983. do
  2984. local sound = Sounds[SFX.Running]
  2985. if activeState == Enum.HumanoidStateType.Running then
  2986. if Util.HorizontalSpeed(Head) < 0.5 then
  2987. Util.Pause(sound)
  2988. end
  2989. end
  2990. end
  2991. end
  2992.  
  2993. local lastTick = tick()
  2994. local TICK_SPEED_SECONDS = 0.25
  2995. while true do
  2996. onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  2997. lastTick = tick()
  2998. wait(TICK_SPEED_SECONDS)
  2999. end
  3000. end
  3001.  
  3002. end))
  3003. Script139.Name = "Animate"
  3004. Script139.Parent = Model0
  3005. table.insert(cors,sandbox(Script139,function()
  3006. function waitForChild(parent, childName)
  3007. local child = parent:findFirstChild(childName)
  3008. if child then return child end
  3009. while true do
  3010. child = parent.ChildAdded:wait()
  3011. if child.Name==childName then return child end
  3012. end
  3013. end
  3014.  
  3015. local Figure = script.Parent
  3016. local Humanoid = waitForChild(Figure, "NPC")
  3017. local pose = "Standing"
  3018.  
  3019. local currentAnim = ""
  3020. local currentAnimInstance = nil
  3021. local currentAnimTrack = nil
  3022. local currentAnimKeyframeHandler = nil
  3023. local currentAnimSpeed = 0.1
  3024. local animTable = {}
  3025. local animNames = {
  3026. idle = {
  3027. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  3028. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  3029. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  3030. },
  3031. walk = {
  3032. { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
  3033. },
  3034. run = {
  3035. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  3036. },
  3037. swim = {
  3038. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  3039. },
  3040. swimidle = {
  3041. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  3042. },
  3043. jump = {
  3044. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  3045. },
  3046. fall = {
  3047. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  3048. },
  3049. climb = {
  3050. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  3051. },
  3052. sit = {
  3053. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  3054. },
  3055. toolnone = {
  3056. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  3057. },
  3058. toolslash = {
  3059. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  3060. -- { id = "slash.xml", weight = 10 }
  3061. },
  3062. toollunge = {
  3063. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  3064. },
  3065. wave = {
  3066. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  3067. },
  3068. point = {
  3069. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  3070. },
  3071. dance = {
  3072. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  3073. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  3074. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  3075. },
  3076. dance2 = {
  3077. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  3078. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  3079. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  3080. },
  3081. dance3 = {
  3082. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  3083. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  3084. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  3085. },
  3086. laugh = {
  3087. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  3088. },
  3089. cheer = {
  3090. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  3091. },
  3092. }
  3093.  
  3094. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  3095. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  3096.  
  3097. math.randomseed(tick())
  3098.  
  3099. function configureAnimationSet(name, fileList)
  3100. if (animTable[name] ~= nil) then
  3101. for _, connection in pairs(animTable[name].connections) do
  3102. connection:disconnect()
  3103. end
  3104. end
  3105. animTable[name] = {}
  3106. animTable[name].count = 0
  3107. animTable[name].totalWeight = 0
  3108. animTable[name].connections = {}
  3109.  
  3110. -- check for config values
  3111. local config = script:FindFirstChild(name)
  3112. if (config ~= nil) then
  3113. -- print("Loading anims " .. name)
  3114. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  3115. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  3116. local idx = 1
  3117. for _, childPart in pairs(config:GetChildren()) do
  3118. if (childPart:IsA("Animation")) then
  3119. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  3120. animTable[name][idx] = {}
  3121. animTable[name][idx].anim = childPart
  3122. local weightObject = childPart:FindFirstChild("Weight")
  3123. if (weightObject == nil) then
  3124. animTable[name][idx].weight = 1
  3125. else
  3126. animTable[name][idx].weight = weightObject.Value
  3127. end
  3128. animTable[name].count = animTable[name].count + 1
  3129. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  3130. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  3131. idx = idx + 1
  3132. end
  3133. end
  3134. end
  3135.  
  3136. -- fallback to defaults
  3137. if (animTable[name].count <= 0) then
  3138. for idx, anim in pairs(fileList) do
  3139. animTable[name][idx] = {}
  3140. animTable[name][idx].anim = Instance.new("Animation")
  3141. animTable[name][idx].anim.Name = name
  3142. animTable[name][idx].anim.AnimationId = anim.id
  3143. animTable[name][idx].weight = anim.weight
  3144. animTable[name].count = animTable[name].count + 1
  3145. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  3146. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  3147. end
  3148. end
  3149. end
  3150.  
  3151. -- Setup animation objects
  3152. function scriptChildModified(child)
  3153. local fileList = animNames[child.Name]
  3154. if (fileList ~= nil) then
  3155. configureAnimationSet(child.Name, fileList)
  3156. end
  3157. end
  3158.  
  3159. script.ChildAdded:connect(scriptChildModified)
  3160. script.ChildRemoved:connect(scriptChildModified)
  3161.  
  3162.  
  3163. for name, fileList in pairs(animNames) do
  3164. configureAnimationSet(name, fileList)
  3165. end
  3166.  
  3167. -- ANIMATION
  3168.  
  3169. -- declarations
  3170. local toolAnim = "None"
  3171. local toolAnimTime = 0
  3172.  
  3173. local jumpAnimTime = 3
  3174. local jumpAnimDuration = 0.31
  3175.  
  3176. local toolTransitionTime = 0.1
  3177. local fallTransitionTime = 0.2
  3178.  
  3179. -- functions
  3180.  
  3181. function stopAllAnimations()
  3182. local oldAnim = currentAnim
  3183.  
  3184. -- return to idle if finishing an emote
  3185. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  3186. oldAnim = "idle"
  3187. end
  3188.  
  3189. currentAnim = ""
  3190. currentAnimInstance = nil
  3191. if (currentAnimKeyframeHandler ~= nil) then
  3192. currentAnimKeyframeHandler:disconnect()
  3193. end
  3194.  
  3195. if (currentAnimTrack ~= nil) then
  3196. currentAnimTrack:Stop()
  3197. currentAnimTrack:Destroy()
  3198. currentAnimTrack = nil
  3199. end
  3200. return oldAnim
  3201. end
  3202.  
  3203. function setAnimationSpeed(speed)
  3204. if speed ~= currentAnimSpeed then
  3205. currentAnimSpeed = speed
  3206. currentAnimTrack:AdjustSpeed(0.8)
  3207. end
  3208. end
  3209.  
  3210. function keyFrameReachedFunc(frameName)
  3211. if (frameName == "End") then
  3212. -- print("Keyframe : ".. frameName)
  3213.  
  3214. local repeatAnim = currentAnim
  3215. -- return to idle if finishing an emote
  3216. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  3217. repeatAnim = "idle"
  3218. end
  3219.  
  3220. local animSpeed = currentAnimSpeed
  3221. playAnimation(repeatAnim, 0.15, Humanoid)
  3222. setAnimationSpeed(0.8)
  3223. end
  3224. end
  3225.  
  3226. -- Preload animations
  3227. function playAnimation(animName, transitionTime, humanoid)
  3228.  
  3229. local roll = math.random(1, animTable[animName].totalWeight)
  3230. local origRoll = roll
  3231. local idx = 1
  3232. while (roll > animTable[animName][idx].weight) do
  3233. roll = roll - animTable[animName][idx].weight
  3234. idx = idx + 1
  3235. end
  3236.  
  3237. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  3238.  
  3239. local anim = animTable[animName][idx].anim
  3240.  
  3241. -- switch animation
  3242. if (anim ~= currentAnimInstance) then
  3243.  
  3244. if (currentAnimTrack ~= nil) then
  3245. currentAnimTrack:Stop(transitionTime)
  3246. currentAnimTrack:Destroy()
  3247. end
  3248.  
  3249. currentAnimSpeed = 0.5
  3250.  
  3251. -- load it to the humanoid; get AnimationTrack
  3252. currentAnimTrack = humanoid:LoadAnimation(anim)
  3253.  
  3254. -- play the animation
  3255. currentAnimTrack:Play(transitionTime)
  3256. currentAnim = animName
  3257. currentAnimInstance = anim
  3258.  
  3259. -- set up keyframe name triggers
  3260. if (currentAnimKeyframeHandler ~= nil) then
  3261. currentAnimKeyframeHandler:disconnect()
  3262. end
  3263. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  3264.  
  3265. end
  3266.  
  3267. end
  3268.  
  3269. -------------------------------------------------------------------------------------------
  3270. -------------------------------------------------------------------------------------------
  3271.  
  3272. local toolAnimName = ""
  3273. local toolAnimTrack = nil
  3274. local toolAnimInstance = nil
  3275. local currentToolAnimKeyframeHandler = nil
  3276.  
  3277. function toolKeyFrameReachedFunc(frameName)
  3278. if (frameName == "End") then
  3279. -- print("Keyframe : ".. frameName)
  3280. playToolAnimation(toolAnimName, 0.0, Humanoid)
  3281. end
  3282. end
  3283.  
  3284.  
  3285. function playToolAnimation(animName, transitionTime, humanoid)
  3286.  
  3287. local roll = math.random(1, animTable[animName].totalWeight)
  3288. local origRoll = roll
  3289. local idx = 1
  3290. while (roll > animTable[animName][idx].weight) do
  3291. roll = roll - animTable[animName][idx].weight
  3292. idx = idx + 1
  3293. end
  3294. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  3295. local anim = animTable[animName][idx].anim
  3296.  
  3297. if (toolAnimInstance ~= anim) then
  3298.  
  3299. if (toolAnimTrack ~= nil) then
  3300. toolAnimTrack:Stop()
  3301. toolAnimTrack:Destroy()
  3302. transitionTime = 0
  3303. end
  3304.  
  3305. -- load it to the humanoid; get AnimationTrack
  3306. toolAnimTrack = humanoid:LoadAnimation(anim)
  3307.  
  3308. -- play the animation
  3309. toolAnimTrack:Play(transitionTime)
  3310. toolAnimName = animName
  3311. toolAnimInstance = anim
  3312.  
  3313. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  3314. end
  3315. end
  3316.  
  3317. function stopToolAnimations()
  3318. local oldAnim = toolAnimName
  3319.  
  3320. if (currentToolAnimKeyframeHandler ~= nil) then
  3321. currentToolAnimKeyframeHandler:disconnect()
  3322. end
  3323.  
  3324. toolAnimName = ""
  3325. toolAnimInstance = nil
  3326. if (toolAnimTrack ~= nil) then
  3327. toolAnimTrack:Stop()
  3328. toolAnimTrack:Destroy()
  3329. toolAnimTrack = nil
  3330. end
  3331.  
  3332.  
  3333. return oldAnim
  3334. end
  3335.  
  3336. -------------------------------------------------------------------------------------------
  3337. -------------------------------------------------------------------------------------------
  3338.  
  3339.  
  3340. function onRunning(speed)
  3341. if speed > 0.01 then
  3342. local scale = 15.0
  3343. playAnimation("walk", 0.1, Humanoid)
  3344. setAnimationSpeed(speed / scale)
  3345. pose = "Running"
  3346. else
  3347. playAnimation("idle", 0.1, Humanoid)
  3348. pose = "Standing"
  3349. end
  3350. end
  3351.  
  3352. function onDied()
  3353. pose = "Dead"
  3354. end
  3355.  
  3356. function onJumping()
  3357. playAnimation("jump", 0.1, Humanoid)
  3358. jumpAnimTime = jumpAnimDuration
  3359. pose = "Jumping"
  3360. end
  3361.  
  3362. function onClimbing(speed)
  3363. local scale = 5.0
  3364. playAnimation("climb", 0.1, Humanoid)
  3365. setAnimationSpeed(speed / scale)
  3366. pose = "Climbing"
  3367. end
  3368.  
  3369. function onGettingUp()
  3370. pose = "GettingUp"
  3371. end
  3372.  
  3373. function onFreeFall()
  3374. if (jumpAnimTime <= 0) then
  3375. playAnimation("fall", fallTransitionTime, Humanoid)
  3376. end
  3377. pose = "FreeFall"
  3378. end
  3379.  
  3380. function onFallingDown()
  3381. pose = "FallingDown"
  3382. end
  3383.  
  3384. function onSeated()
  3385. pose = "Seated"
  3386. end
  3387.  
  3388. function onPlatformStanding()
  3389. pose = "PlatformStanding"
  3390. end
  3391.  
  3392. function onSwimming(speed)
  3393. if speed > 1.00 then
  3394. local scale = 10.0
  3395. playAnimation("swim", 0.4, Humanoid)
  3396. setAnimationSpeed(speed / scale)
  3397. pose = "Swimming"
  3398. else
  3399. playAnimation("swimidle", 0.4, Humanoid)
  3400. pose = "Standing"
  3401. end
  3402. end
  3403.  
  3404. function getTool()
  3405. for _, kid in ipairs(Figure:GetChildren()) do
  3406. if kid.className == "Tool" then return kid end
  3407. end
  3408. return nil
  3409. end
  3410.  
  3411. function getToolAnim(tool)
  3412. for _, c in ipairs(tool:GetChildren()) do
  3413. if c.Name == "toolanim" and c.className == "StringValue" then
  3414. return c
  3415. end
  3416. end
  3417. return nil
  3418. end
  3419.  
  3420. function animateTool()
  3421.  
  3422. if (toolAnim == "None") then
  3423. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  3424. return
  3425. end
  3426.  
  3427. if (toolAnim == "Slash") then
  3428. playToolAnimation("toolslash", 0, Humanoid)
  3429. return
  3430. end
  3431.  
  3432. if (toolAnim == "Lunge") then
  3433. playToolAnimation("toollunge", 0, Humanoid)
  3434. return
  3435. end
  3436. end
  3437.  
  3438. function moveSit()
  3439. RightShoulder.MaxVelocity = 0.15
  3440. LeftShoulder.MaxVelocity = 0.15
  3441. RightShoulder:SetDesiredAngle(3.14 /2)
  3442. LeftShoulder:SetDesiredAngle(-3.14 /2)
  3443. RightHip:SetDesiredAngle(3.14 /2)
  3444. LeftHip:SetDesiredAngle(-3.14 /2)
  3445. end
  3446.  
  3447. local lastTick = 0
  3448.  
  3449. function move(time)
  3450. local amplitude = 1
  3451. local frequency = 1
  3452. local deltaTime = time - lastTick
  3453. lastTick = time
  3454.  
  3455. local climbFudge = 0
  3456. local setAngles = false
  3457.  
  3458. if (jumpAnimTime > 0) then
  3459. jumpAnimTime = jumpAnimTime - deltaTime
  3460. end
  3461.  
  3462. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  3463. playAnimation("fall", fallTransitionTime, Humanoid)
  3464. elseif (pose == "Seated") then
  3465. playAnimation("sit", 0.5, Humanoid)
  3466. return
  3467. elseif (pose == "Running") then
  3468. playAnimation("walk", 0.1, Humanoid)
  3469. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  3470. stopAllAnimations()
  3471. amplitude = 0.1
  3472. frequency = 1
  3473. setAngles = true
  3474. end
  3475.  
  3476. -- Tool Animation handling
  3477. local tool = getTool()
  3478. if tool then
  3479.  
  3480. animStringValueObject = getToolAnim(tool)
  3481.  
  3482. if animStringValueObject then
  3483. toolAnim = animStringValueObject.Value
  3484. -- message recieved, delete StringValue
  3485. animStringValueObject.Parent = nil
  3486. toolAnimTime = time + .3
  3487. end
  3488.  
  3489. if time > toolAnimTime then
  3490. toolAnimTime = 0
  3491. toolAnim = "None"
  3492. end
  3493.  
  3494. animateTool()
  3495. else
  3496. stopToolAnimations()
  3497. toolAnim = "None"
  3498. toolAnimInstance = nil
  3499. toolAnimTime = 0
  3500. end
  3501. end
  3502.  
  3503. -- connect events
  3504. Humanoid.Died:connect(onDied)
  3505. Humanoid.Running:connect(onRunning)
  3506. Humanoid.Jumping:connect(onJumping)
  3507. Humanoid.Climbing:connect(onClimbing)
  3508. Humanoid.GettingUp:connect(onGettingUp)
  3509. Humanoid.FreeFalling:connect(onFreeFall)
  3510. Humanoid.FallingDown:connect(onFallingDown)
  3511. Humanoid.Seated:connect(onSeated)
  3512. Humanoid.PlatformStanding:connect(onPlatformStanding)
  3513. Humanoid.Swimming:connect(onSwimming)
  3514.  
  3515. -- setup emote chat hook
  3516. script.msg.Changed:connect(function(msg)
  3517. script.msg.Value = ""
  3518. local emote = ""
  3519. if (string.sub(msg, 1, 3) == "/e ") then
  3520. emote = string.sub(msg, 4)
  3521. elseif (string.sub(msg, 1, 7) == "/emote ") then
  3522. emote = string.sub(msg, 8)
  3523. end
  3524.  
  3525. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  3526. playAnimation(emote, 0.1, Humanoid)
  3527. end
  3528. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  3529. end)
  3530.  
  3531.  
  3532. -- main program
  3533.  
  3534. local runService = game:service("RunService");
  3535.  
  3536. -- print("bottom")
  3537.  
  3538. -- initialize to idle
  3539. playAnimation("idle", 0.1, Humanoid)
  3540. pose = "Standing"
  3541.  
  3542. while Figure.Parent~=nil do
  3543. local _, time = wait(0.1)
  3544. move(time)
  3545. end
  3546.  
  3547.  
  3548.  
  3549. end))
  3550. StringValue140.Name = "climb"
  3551. StringValue140.Parent = Script139
  3552. Animation141.Name = "ClimbAnim"
  3553. Animation141.Parent = StringValue140
  3554. Animation141.AnimationId = "http://www.roblox.com/asset/?id=387946868"
  3555. StringValue142.Name = "fall"
  3556. StringValue142.Parent = Script139
  3557. Animation143.Name = "FallAnim"
  3558. Animation143.Parent = StringValue142
  3559. Animation143.AnimationId = "http://www.roblox.com/asset/?id=387948187"
  3560. StringValue144.Name = "idle"
  3561. StringValue144.Parent = Script139
  3562. Animation145.Name = "Animation1"
  3563. Animation145.Parent = StringValue144
  3564. Animation145.AnimationId = "http://www.roblox.com/asset/?id=387947158"
  3565. NumberValue146.Name = "Weight"
  3566. NumberValue146.Parent = Animation145
  3567. NumberValue146.Value = 9
  3568. Animation147.Name = "Animation2"
  3569. Animation147.Parent = StringValue144
  3570. Animation147.AnimationId = "http://www.roblox.com/asset/?id=387947464"
  3571. NumberValue148.Name = "Weight"
  3572. NumberValue148.Parent = Animation147
  3573. NumberValue148.Value = 1
  3574. Animation149.Name = "Animation3"
  3575. Animation149.Parent = StringValue144
  3576. Animation149.AnimationId = "http://www.roblox.com/asset/?id=387947796"
  3577. NumberValue150.Name = "Weight"
  3578. NumberValue150.Parent = Animation149
  3579. NumberValue150.Value = 1
  3580. StringValue151.Name = "jump"
  3581. StringValue151.Parent = Script139
  3582. Animation152.Name = "JumpAnim"
  3583. Animation152.Parent = StringValue151
  3584. Animation152.AnimationId = "http://www.roblox.com/asset/?id=387946624"
  3585. StringValue153.Name = "run"
  3586. StringValue153.Parent = Script139
  3587. Animation154.Name = "RunAnim"
  3588. Animation154.Parent = StringValue153
  3589. Animation154.AnimationId = "http://www.roblox.com/asset/?id=387947975"
  3590. StringValue155.Name = "sit"
  3591. StringValue155.Parent = Script139
  3592. Animation156.Name = "SitAnim"
  3593. Animation156.Parent = StringValue155
  3594. Animation156.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  3595. StringValue157.Name = "toolnone"
  3596. StringValue157.Parent = Script139
  3597. Animation158.Name = "ToolNoneAnim"
  3598. Animation158.Parent = StringValue157
  3599. Animation158.AnimationId = "http://www.roblox.com/asset/?id=387947975"
  3600. Script159.Name = "Health"
  3601. Script159.Parent = Model0
  3602. table.insert(cors,sandbox(Script159,function()
  3603. --Responsible for regening a player's humanoid's health
  3604.  
  3605. -- declarations
  3606. local Figure = script.Parent
  3607. local Head = Figure:WaitForChild("Head")
  3608. local Humanoid = Figure:WaitForChild("NPC")
  3609. local regening = false
  3610.  
  3611. -- regeneration
  3612. function regenHealth()
  3613. if regening then return end
  3614. regening = true
  3615.  
  3616. while Humanoid.Health < Humanoid.MaxHealth do
  3617. local s = wait(1)
  3618. local health = Humanoid.Health
  3619. if health > 0 and health < Humanoid.MaxHealth then
  3620. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  3621. health = health + newHealthDelta
  3622. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  3623. end
  3624. end
  3625.  
  3626. if Humanoid.Health > Humanoid.MaxHealth then
  3627. Humanoid.Health = Humanoid.MaxHealth
  3628. end
  3629.  
  3630. regening = false
  3631. end
  3632.  
  3633. Humanoid.HealthChanged:connect(regenHealth)
  3634.  
  3635. end))
  3636. Script160.Parent = Model0
  3637. table.insert(cors,sandbox(Script160,function()
  3638. local larm = script.Parent:FindFirstChild("HumanoidRootPart")
  3639. local rarm = script.Parent:FindFirstChild("HumanoidRootPart")
  3640.  
  3641. function findNearestTorso(pos)
  3642. local list = game.Workspace:children()
  3643. local torso = nil
  3644. local dist = 3500
  3645. local temp = nil
  3646. local human = nil
  3647. local temp2 = nil
  3648. for x = 1, #list do
  3649. temp2 = list[x]
  3650. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  3651. temp = temp2:findFirstChild("HumanoidRootPart")
  3652. human = temp2:findFirstChild("Humanoid")
  3653. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  3654. if (temp.Position - pos).magnitude < dist then
  3655. torso = temp
  3656. dist = (temp.Position - pos).magnitude
  3657. end
  3658. end
  3659. end
  3660. end
  3661. return torso
  3662. end
  3663.  
  3664.  
  3665.  
  3666.  
  3667. while true do
  3668. wait(math.random(1,5))
  3669. local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
  3670. if target ~= nil then
  3671. script.Parent.NPC:MoveTo(target.Position, target)
  3672. end
  3673.  
  3674. end
  3675.  
  3676. end))
  3677. Script161.Name = "SprintScriptImporter"
  3678. Script161.Parent = Model0
  3679. table.insert(cors,sandbox(Script161,function()
  3680. function onPlayerEntered(player)
  3681. repeat wait () until player.Character ~= nil
  3682. local s = script.SprintScript:clone()
  3683. s.Parent = player.Character
  3684. s.Disabled = false
  3685. player.CharacterAdded:connect(function (char)
  3686. local s = script.SprintScript:clone()
  3687. s.Parent = char
  3688. s.Disabled = false
  3689. end)
  3690. end
  3691.  
  3692. game.Players.PlayerAdded:connect(onPlayerEntered) -- Go to Children and do SprintScript to edit the speed
  3693. end))
  3694. LocalScript162.Name = "SprintScript"
  3695. LocalScript162.Parent = Script161
  3696. LocalScript162.Disabled = true
  3697. table.insert(cors,sandbox(LocalScript162,function()
  3698. local mouse = game.Players.LocalPlayer:GetMouse()
  3699. local running = false
  3700.  
  3701. function getTool()
  3702. for _, kid in ipairs(script.Parent:GetChildren()) do
  3703. if kid.className == "Tool" then return kid end
  3704. end
  3705. return nil
  3706. end
  3707.  
  3708.  
  3709. mouse.KeyDown:connect(function (key) -- Run function
  3710. key = string.lower(key)
  3711. if string.byte(key) == 48 then
  3712. running = true
  3713. local keyConnection = mouse.KeyUp:connect(function (key)
  3714. if string.byte(key) == 48 then
  3715. running = false
  3716. end
  3717. end)
  3718. for i = 1,5 do
  3719. game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
  3720. wait()
  3721. end
  3722. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 40 -- Edit this to what you want while sprinting
  3723. repeat wait () until running == false
  3724. keyConnection:disconnect()
  3725. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
  3726. for i = 1,5 do
  3727. game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
  3728. wait()
  3729. end
  3730. end
  3731. end) -- TheSecondPower
  3732. end))
  3733. Script163.Name = "SuperRun"
  3734. Script163.Parent = Model0
  3735. table.insert(cors,sandbox(Script163,function()
  3736. function makeRun(character)
  3737. local h = character:FindFirstChild("Humanoid")
  3738. if (h~= nil) then
  3739. h.WalkSpeed = 46
  3740. end
  3741.  
  3742. end
  3743.  
  3744. function onPlayerRespawn(property, player)
  3745. -- need to connect to new humanoid
  3746.  
  3747. if property == "Character" and player.Character ~= nil then
  3748. makeRun(player.Character)
  3749. end
  3750. end
  3751.  
  3752.  
  3753.  
  3754. function onPlayerEntered(newPlayer)
  3755. -- VERY UGLY HACK
  3756. -- Will this leak threads?
  3757. -- Is the problem even what I think it is (player arrived before character)?
  3758. while true do
  3759. if newPlayer.Character ~= nil then break end
  3760. wait(1)
  3761. end
  3762.  
  3763. -- start to listen for new humanoid
  3764. newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
  3765.  
  3766. makeRun(newPlayer.Character)
  3767. end
  3768.  
  3769.  
  3770. game.Players.ChildAdded:connect(onPlayerEntered)
  3771.  
  3772.  
  3773.  
  3774.  
  3775. end))
  3776. ObjectValue164.Name = "IsNZ"
  3777. ObjectValue164.Parent = Model0
  3778. Pants165.Name = "Pants"
  3779. Pants165.Parent = Model0
  3780. Pants165.PantsTemplate = "http://www.roblox.com/asset/?id=159001588"
  3781. Shirt166.Name = "Shirt"
  3782. Shirt166.Parent = Model0
  3783. Shirt166.ShirtTemplate = "http://www.roblox.com/asset/?id=168348645"
  3784. Script167.Name = "MusicScript"
  3785. Script167.Parent = Model0
  3786. table.insert(cors,sandbox(Script167,function()
  3787. --Made by Stickmasterluke
  3788. gw=game.Workspace
  3789.  
  3790. function message(text,time)
  3791. local oldmsg=gw:FindFirstChild("Hint")
  3792. if oldmsg then
  3793. oldmsg.Parent=nil
  3794. end
  3795. local spacenumber=time*0
  3796. local msg=Instance.new("Hint")
  3797. msg.Parent=gw
  3798. --[[for i=1, spacenumber do
  3799. wait(1/25)
  3800. local maketext=""
  3801. for i2=1, i do
  3802. maketext=maketext.." "
  3803. end
  3804. maketext=maketext..text
  3805. for i2=1, spacenumber-i do
  3806. maketext=maketext.." "
  3807. end
  3808. msg.Text=maketext
  3809. end]]
  3810. msg.Text=text
  3811. wait(0)
  3812. msg.Parent=nil
  3813. end
  3814.  
  3815. last=""
  3816. lastlast=""
  3817. while true do
  3818. wait(0)
  3819. local tracks=script:GetChildren()
  3820. local rn=math.random(1,#tracks)
  3821. local track=tracks[rn]
  3822. if track~=nil then
  3823. if track.className=="Sound" and track.Name~=last and track.Name~=lastlast then
  3824. lastlast=last
  3825. last=track.Name
  3826. message(track.Name,50)
  3827. track:play()
  3828. wait(10000000000000000000000000)
  3829. track:pause()
  3830. end
  3831. end
  3832. end
  3833.  
  3834. end))
  3835. Sound168.Name = "Shrek Anthem"
  3836. Sound168.Parent = Script167
  3837. Sound168.SoundId = "http://www.roblox.com/asset/?id=152828706"
  3838. Sound168.Volume = 1
  3839. Sound168.Looped = true
  3840. for i,v in pairs(mas:GetChildren()) do
  3841. v.Parent = workspace
  3842. pcall(function() v:MakeJoints() end)
  3843. end
  3844. mas:Destroy()
  3845. for i,v in pairs(cors) do
  3846. spawn(function()
  3847. pcall(v)
  3848. end)
  3849. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement