Advertisement
DylanD2003

Untitled

Sep 28th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.02 KB | None | 0 0
  1. local isScriptNil = false
  2.  
  3. local Hint = Instance.new('Hint', game.Workspace)
  4. Hint.Text = "Script Loaded... Made by Cronizete"
  5. wait(2)
  6. Hint:Destroy()
  7. local PlrName = "fennybunny"
  8. local Plrs = game:GetService("Players")
  9. local RunService = game:GetService("RunService")
  10. local Content = game:GetService("ContentProvider")
  11. local LP = Plrs.LocalPlayer
  12. local Char = LP.Character
  13. local PlrGui = LP.PlayerGui
  14. local Backpack = LP.Backpack
  15. local Mouse = LP:GetMouse()
  16.  
  17. local Camera = Workspace.CurrentCamera
  18. local LastCamCF = Camera.CoordinateFrame
  19. local AnimJoints = {}
  20. local Cons = {}
  21. local mDown = false
  22. local Multi = false
  23. local Grabbing = false
  24. local Current = {}
  25. local Alpha = 1
  26. local LightNum = 1
  27.  
  28. Current.Part = nil
  29. Current.BP = nil
  30. Current.BA = nil
  31. Current.Mass = nil
  32.  
  33. local LastPart = nil
  34.  
  35. local Head = Char["Head"]
  36. local Torso = Char["Torso"]
  37. local Humanoid = Char["Humanoid"]
  38. local LA = Char["Left Arm"]
  39. local RA = Char["Right Arm"]
  40. local LL = Char["Left Leg"]
  41. local RL = Char["Right Leg"]
  42.  
  43. local LS, RS;
  44.  
  45. local OrigLS = Torso["Left Shoulder"]
  46. local OrigRS = Torso["Right Shoulder"]
  47.  
  48. for _,v in pairs(Char:GetChildren()) do
  49. if v.Name == ModID then
  50. v:Destroy()
  51. end
  52. end
  53.  
  54. for _,v in pairs(PlrGui:GetChildren()) do
  55. if v.Name == "PadsGui" then
  56. v:Destroy()
  57. end
  58. end
  59.  
  60. local ModID = "Pads"
  61. local Objects = {}
  62. local Grav = 196.2
  63.  
  64. local sin=math.sin
  65. local cos=math.cos
  66. local max=math.max
  67. local min=math.min
  68. local atan2=math.atan2
  69. local random=math.random
  70. local tau = 2 * math.pi
  71.  
  72. local BodyObjects = {
  73. ["BodyVelocity"] = true;
  74. ["BodyAngularVelocity"] = true;
  75. ["BodyForce"] = true;
  76. ["BodyThrust"] = true;
  77. ["BodyPosition"] = true;
  78. ["RocketPropulsion"] = true;
  79. }
  80.  
  81. if LP.Name == PlrName and isScriptNil then
  82. script.Parent = nil
  83. end
  84.  
  85. LP.CameraMode = "Classic"
  86.  
  87. local Assets = {
  88. }
  89.  
  90. local LS0, LS1 = OrigLS.C0, OrigLS.C1
  91. local RS0, RS1 = OrigRS.C0, OrigRS.C1
  92.  
  93. for i,v in pairs(Assets) do
  94. local ID = tostring(Assets[i])
  95. Assets[i] = "http://www.roblox.com/asset/?id=" .. ID
  96. Content:Preload("http://www.roblox.com/asset/?id=" .. ID)
  97. end
  98.  
  99. function QuaternionFromCFrame(cf)
  100. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components();
  101. local trace = m00 + m11 + m22 if trace > 0 then
  102. local s = math.sqrt(1 + trace);
  103. local recip = 0.5/s;
  104. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5;
  105. else
  106. local i = 0;
  107. if m11 > m00 then
  108. i = 1;
  109. end;
  110. if m22 > (i == 0 and m00 or m11) then
  111. i = 2 end if i == 0 then
  112. local s = math.sqrt(m00-m11-m22+1);
  113. local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip;
  114. elseif i == 1 then
  115. local s = math.sqrt(m11-m22-m00+1);
  116. local recip = 0.5/s;
  117. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ;
  118. elseif i == 2 then
  119. local s = math.sqrt(m22-m00-m11+1);
  120. local recip = 0.5/s;
  121. return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip;
  122. end;
  123. end;
  124. end;
  125.  
  126. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  127. local xs, ys, zs = x + x, y + y, z + z;
  128. local wx, wy, wz = w*xs, w*ys, w*zs;
  129. local xx = x*xs;
  130. local xy = x*ys;
  131. local xz = x*zs;
  132. local yy = y*ys;
  133. local yz = y*zs;
  134. local zz = z*zs;
  135. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  136. end;
  137.  
  138. function QuaternionSlerp(a, b, t)
  139. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4];
  140. local startInterp, finishInterp;
  141. if cosTheta >= 0.0001 then
  142. if (1 - cosTheta) > 0.0001 then
  143. local theta = math.acos(cosTheta);
  144. local invSinTheta = 1/math.sin(theta);
  145. startInterp = math.sin((1-t)*theta)*invSinTheta;
  146. finishInterp = math.sin(t*theta)*invSinTheta;
  147. else
  148. startInterp = 1-t finishInterp = t;
  149. end;
  150. else
  151. if (1+cosTheta) > 0.0001 then
  152. local theta = math.acos(-cosTheta);
  153. local invSinTheta = 1/math.sin(theta);
  154. startInterp = math.sin((t-1)*theta)*invSinTheta;
  155. finishInterp = math.sin(t*theta)*invSinTheta;
  156. else startInterp = t-1 finishInterp = t;
  157. end;
  158. end;
  159. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp;
  160. end;
  161.  
  162. function CLerp(a,b,t)
  163. local qa={QuaternionFromCFrame(a)};
  164. local qb={QuaternionFromCFrame(b)};
  165. local ax,ay,az=a.x,a.y,a.z;
  166. local bx,by,bz=b.x,b.y,b.z;
  167. local _t=1-t;
  168. return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t));
  169. end
  170.  
  171. function GetWeld(weld)
  172. local obj
  173. for i, v in pairs(AnimJoints) do
  174. if v[1] == weld then
  175. obj = v
  176. break
  177. end
  178. end
  179. if not obj then
  180. obj = {weld,NV}
  181. table.insert(AnimJoints,obj)
  182. end
  183. return weld.C0.p, obj[2]
  184. end
  185.  
  186. function SetWeld(weld, i, loops, origpos, origangle, nextpos, nextangle, override, overrideLower, smooth)
  187. smooth = smooth or 1
  188. local obj
  189. for i, v in pairs(AnimJoints) do
  190. if v[1] == weld then
  191. obj = v
  192. break
  193. end
  194. end
  195. if not obj then
  196. obj = {weld,NV}
  197. table.insert(AnimJoints,obj)
  198. end
  199.  
  200. local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
  201.  
  202. local tox,toy,toz = 0,0,0
  203. tox = math.abs(origangle.x - nextangle.x) *perc
  204. toy = math.abs(origangle.y - nextangle.y) *perc
  205. toz = math.abs(origangle.z - nextangle.z) *perc
  206. tox = ((origangle.x > nextangle.x and -tox) or tox)
  207. toy = ((origangle.y > nextangle.y and -toy) or toy)
  208. toz = ((origangle.z > nextangle.z and -toz) or toz)
  209.  
  210. local tox2,toy2,toz2 = 0,0,0
  211. tox2 = math.abs(origpos.x - nextpos.x) *perc
  212. toy2 = math.abs(origpos.y - nextpos.y) *perc
  213. toz2 = math.abs(origpos.z - nextpos.z) *perc
  214. tox2 = (origpos.x > nextpos.x and -tox2) or tox2
  215. toy2 = (origpos.y > nextpos.y and -toy2) or toy2
  216. toz2 = (origpos.z > nextpos.z and -toz2) or toz2
  217.  
  218. obj[2] = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  219. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  220. end
  221.  
  222. function RotateCamera(x, y)
  223. Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(x, y, 0) * CFrame.new(0, 0, (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude)
  224. end
  225.  
  226. function GetAngles(cf)
  227. local lv = cf.lookVector
  228. return -math.asin(lv.y), math.atan2(lv.x, -lv.z)
  229. end
  230.  
  231. local LastCamCF = Camera.CoordinateFrame
  232.  
  233. function Look()
  234. if AlphaOn == true then
  235. local x, y = GetAngles(LastCamCF:toObjectSpace(Camera.CoordinateFrame))
  236. Camera.CoordinateFrame = LastCamCF
  237. RotateCamera(x * -(Alpha), y * -(Alpha))
  238. LastCamCF = Camera.CoordinateFrame
  239. end
  240. end
  241.  
  242. function Cor(Func)
  243. local Ok, Err = coroutine.resume(coroutine.create(Func))
  244. if not Ok then
  245. print(Err)
  246. end
  247. end
  248.  
  249. function Cor2(Func)
  250. local Ok, Err = ypcall(Func)
  251. if not Ok then
  252. print(Err)
  253. end
  254. end
  255.  
  256. function MakePads()
  257. -- 1 - VTelekinesis
  258. P1 = Instance.new("Model")
  259. P1.Name = ModID
  260.  
  261. -- 2 - RBase
  262. P2 = Instance.new("Part")
  263. P2.CFrame = CFrame.new(Vector3.new(21.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
  264. P2.FormFactor = Enum.FormFactor.Custom
  265. P2.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
  266. P2.Anchored = true
  267. P2.BrickColor = BrickColor.new("Crimson")
  268. P2.Friction = 0.30000001192093
  269. P2.Shape = Enum.PartType.Block
  270. P2.Name = "RBase"
  271. P2.Parent = P1
  272.  
  273. -- 3 - Mesh
  274. P3 = Instance.new("CylinderMesh")
  275. P3.Scale = Vector3.new(1, 0.5, 1)
  276. P3.Parent = P2
  277.  
  278. -- 4 - LBase
  279. P4 = Instance.new("Part")
  280. P4.CFrame = CFrame.new(Vector3.new(18.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
  281. P4.FormFactor = Enum.FormFactor.Custom
  282. P4.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
  283. P4.Anchored = true
  284. P4.BrickColor = BrickColor.new("Crimson")
  285. P4.Friction = 0.30000001192093
  286. P4.Shape = Enum.PartType.Block
  287. P4.Name = "LBase"
  288. P4.Parent = P1
  289.  
  290. -- 5 - Mesh
  291. P5 = Instance.new("CylinderMesh")
  292. P5.Scale = Vector3.new(1, 0.5, 1)
  293. P5.Parent = P4
  294.  
  295. -- 6 - RP1
  296. P6 = Instance.new("Part")
  297. P6.CFrame = CFrame.new(Vector3.new(20.8999996, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
  298. P6.FormFactor = Enum.FormFactor.Custom
  299. P6.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  300. P6.Anchored = true
  301. P6.BrickColor = BrickColor.new("Black")
  302. P6.Friction = 0.30000001192093
  303. P6.Shape = Enum.PartType.Block
  304. P6.Name = "RP1"
  305. P6.Parent = P2
  306.  
  307. -- 7 - Mesh
  308. P7 = Instance.new("CylinderMesh")
  309. P7.Scale = Vector3.new(1, 0.5, 1)
  310. P7.Parent = P6
  311.  
  312. -- 8 - RP2
  313. P8 = Instance.new("Part")
  314. P8.CFrame = CFrame.new(Vector3.new(21.1000004, 1.8499999, 11.6999998)) * CFrame.Angles(-0, 0, -0)
  315. P8.FormFactor = Enum.FormFactor.Custom
  316. P8.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  317. P8.Anchored = true
  318. P8.BrickColor = BrickColor.new("Black")
  319. P8.Friction = 0.30000001192093
  320. P8.Shape = Enum.PartType.Block
  321. P8.Name = "RP2"
  322. P8.Parent = P2
  323.  
  324. -- 9 - Mesh
  325. P9 = Instance.new("CylinderMesh")
  326. P9.Scale = Vector3.new(1, 0.5, 1)
  327. P9.Parent = P8
  328.  
  329. -- 10 - RP3
  330. P10 = Instance.new("Part")
  331. P10.CFrame = CFrame.new(Vector3.new(21.3000011, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
  332. P10.FormFactor = Enum.FormFactor.Custom
  333. P10.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  334. P10.Anchored = true
  335. P10.BrickColor = BrickColor.new("Black")
  336. P10.Friction = 0.30000001192093
  337. P10.Shape = Enum.PartType.Block
  338. P10.Name = "RP3"
  339. P10.Parent = P2
  340.  
  341. -- 11 - Mesh
  342. P11 = Instance.new("CylinderMesh")
  343. P11.Scale = Vector3.new(1, 0.5, 1)
  344. P11.Parent = P10
  345.  
  346. -- 12 - LP1
  347. P12 = Instance.new("Part")
  348. P12.CFrame = CFrame.new(Vector3.new(17.8999996, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
  349. P12.FormFactor = Enum.FormFactor.Custom
  350. P12.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  351. P12.Anchored = true
  352. P12.BrickColor = BrickColor.new("Black")
  353. P12.Friction = 0.30000001192093
  354. P12.Shape = Enum.PartType.Block
  355. P12.Name = "LP1"
  356. P12.Parent = P4
  357.  
  358. -- 13 - Mesh
  359. P13 = Instance.new("CylinderMesh")
  360. P13.Scale = Vector3.new(1, 0.5, 1)
  361. P13.Parent = P12
  362.  
  363. -- 14 - LP2
  364. P14 = Instance.new("Part")
  365. P14.CFrame = CFrame.new(Vector3.new(18.1000004, 1.8499999, 11.6999998)) * CFrame.Angles(-0, 0, -0)
  366. P14.FormFactor = Enum.FormFactor.Custom
  367. P14.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  368. P14.Anchored = true
  369. P14.BrickColor = BrickColor.new("Black")
  370. P14.Friction = 0.30000001192093
  371. P14.Shape = Enum.PartType.Block
  372. P14.Name = "LP2"
  373. P14.Parent = P4
  374.  
  375. -- 15 - Mesh
  376. P15 = Instance.new("CylinderMesh")
  377. P15.Scale = Vector3.new(1, 0.5, 1)
  378. P15.Parent = P14
  379.  
  380. -- 16 - LP3
  381. P16 = Instance.new("Part")
  382. P16.CFrame = CFrame.new(Vector3.new(18.3000011, 1.8499999, 12.0499992)) * CFrame.Angles(-0, 0, -0)
  383. P16.FormFactor = Enum.FormFactor.Custom
  384. P16.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  385. P16.Anchored = true
  386. P16.BrickColor = BrickColor.new("Black")
  387. P16.Friction = 0.30000001192093
  388. P16.Shape = Enum.PartType.Block
  389. P16.Name = "LP3"
  390. P16.Parent = P4
  391.  
  392. -- 17 - Mesh
  393. P17 = Instance.new("CylinderMesh")
  394. P17.Scale = Vector3.new(1, 0.5, 1)
  395. P17.Parent = P16
  396.  
  397. P1.Parent = LP.Character
  398. P1:MakeJoints()
  399. return P1
  400. end
  401.  
  402. weldModel = function(model, unanchor, rooty)
  403. local parts = {}
  404. local function recurse(object)
  405. if object:IsA("BasePart") then
  406. table.insert(parts, object)
  407. end
  408. for _,child in pairs(object:GetChildren()) do
  409. recurse(child)
  410. end
  411. end
  412. recurse(model)
  413.  
  414. local rootPart = rooty or parts[1]
  415. for _, part in pairs(parts) do
  416. local cframe = rootPart.CFrame:toObjectSpace(part.CFrame)
  417. local weld = Instance.new("Weld")
  418. weld.Part0 = rootPart
  419. weld.Part1 = part
  420. weld.C0 = cframe
  421. weld.Parent = rootPart
  422. end
  423.  
  424. if unanchor then
  425. for _, part in pairs(parts) do
  426. part.Anchored = false
  427. part.CanCollide = false
  428. end
  429. end
  430. end
  431.  
  432. weldItem = function(rootPart, Item, TheC0, unanchor, ParentItem)
  433. local cframe = TheC0 or rootPart.CFrame:toObjectSpace(Item.CFrame)
  434. local weld = Instance.new("Weld")
  435. weld.Name = "Weld"
  436. weld.Part0 = rootPart
  437. weld.Part1 = Item
  438. weld.C0 = cframe
  439. weld.Parent = ParentItem and Item or rootPart
  440.  
  441. if unanchor then
  442. Item.Anchored = false
  443. end
  444. return weld, cframe
  445. end
  446.  
  447. scaleModel = function(model, scale)
  448. local parts = {}
  449. local function recurse(object)
  450. if object:IsA("BasePart") then
  451. table.insert(parts, object)
  452. end
  453. for _,child in pairs(object:GetChildren()) do
  454. recurse(child)
  455. end
  456. end
  457. recurse(model)
  458.  
  459. local top, bottom, left, right, back, front
  460. for _, part in pairs(parts) do
  461. if top == nil or top < part.Position.y then top = part.Position.y end
  462. if bottom == nil or bottom > part.Position.y then bottom = part.Position.y end
  463. if left == nil or left > part.Position.x then left = part.Position.x end
  464. if right == nil or right < part.Position.x then right = part.Position.x end
  465. if back == nil or back > part.Position.z then back = part.Position.z end
  466. if front == nil or front < part.Position.z then front = part.Position.z end
  467. end
  468.  
  469. local middle = Vector3.new( left+right, top+bottom, back+front )/2
  470. local minSize = Vector3.new(0.2, 0.2, 0.2)
  471.  
  472. for _, part in pairs(parts) do
  473. local foo = part.CFrame.p - middle
  474. local rotation = part.CFrame - part.CFrame.p
  475. local newSize = part.Size*scale
  476. part.FormFactor = "Custom"
  477. part.Size = newSize
  478. part.CFrame = CFrame.new( middle + foo*scale ) * rotation
  479.  
  480. if newSize.x < minSize.x or newSize.y < minSize.y or newSize.z < minSize.z then
  481. local mesh
  482. for _, child in pairs(part:GetChildren()) do
  483. if child:IsA("DataModelMesh") then
  484. mesh = child
  485. break
  486. end
  487. end
  488.  
  489. if mesh == nil then
  490. mesh = Instance.new("BlockMesh", part)
  491. end
  492.  
  493. local oScale = mesh.Scale
  494. local newScale = newSize/minSize * oScale
  495. if 0.2 < newSize.x then newScale = Vector3.new(1 * oScale.x, newScale.y, newScale.z) end
  496. if 0.2 < newSize.y then newScale = Vector3.new(newScale.x, 1 * oScale.y, newScale.z) end
  497. if 0.2 < newSize.z then newScale = Vector3.new(newScale.x, newScale.y, 1 * oScale.z) end
  498.  
  499. mesh.Scale = newScale
  500. end
  501. end
  502. end
  503.  
  504. function getMass(Obj, Total)
  505. local newTotal = Total
  506. local returnTotal = 0
  507.  
  508. if Obj:IsA("BasePart") then
  509. newTotal = newTotal + Objects[Obj]
  510. elseif BodyObjects[Obj.ClassName] then
  511. Obj:Destroy()
  512. end
  513.  
  514. if Obj:GetChildren() and #Obj:GetChildren() > 0 then
  515. for _,v in pairs(Obj:GetChildren()) do
  516. returnTotal = returnTotal + getMass(v, newTotal)
  517. end
  518. else
  519. returnTotal = newTotal
  520. end
  521.  
  522. return returnTotal
  523. end
  524.  
  525. function getTargFromCurrent()
  526. local Current = Current.Part
  527. if Current:IsA("BasePart") then
  528. return Current
  529. elseif Current:findFirstChild("Torso") then
  530. return Current.Torso
  531. else
  532. for _,v in pairs(Current:GetChildren()) do
  533. if v:IsA("BasePart") then
  534. return v
  535. end
  536. end
  537. end
  538. end
  539.  
  540. function Fire(Part, Vec, Inv)
  541. pcall(function()
  542. Current.BP:Destroy()
  543. Current.BP = nil
  544. end)
  545. pcall(function()
  546. Current.BA:Destroy()
  547. Current.BA = nil
  548. end)
  549. pcall(function()
  550. if Inv then
  551. Part.Velocity = -((Vec - Torso.Position).unit * Grav * 1.1)
  552. else
  553. Part.Velocity = ((Vec - Camera.CoordinateFrame.p).unit * Grav * 1.1)
  554. end
  555. Current.Mass = nil
  556. end)
  557. Reset()
  558. end
  559.  
  560. function Reset()
  561. LS.Parent = nil
  562. RS.Parent = nil
  563.  
  564. OrigLS.Parent = Torso
  565. OrigRS.Parent = Torso
  566.  
  567. OrigLS.C0 = LS0
  568. OrigRS.C0 = RS0
  569. end
  570.  
  571. function Start()
  572. Cor(function()
  573. repeat wait(1/30) until LP.Character and LP.Character.Parent == Workspace and LP.Character:findFirstChild("Torso")
  574. Char = LP.Character
  575. PlrGui = LP.PlayerGui
  576. Backpack = LP.Backpack
  577. Mouse = LP:GetMouse()
  578.  
  579. for _,v in pairs(Cons) do
  580. v:disconnect()
  581. end
  582. Cons = {}
  583.  
  584. Camera = Workspace.CurrentCamera
  585. LastCamCF = Camera.CoordinateFrame
  586. AnimJoints = {}
  587. mDown = false
  588. Multi = false
  589. Grabbing = false
  590. Current = {}
  591. Alpha = 1
  592.  
  593. Head = Char["Head"]
  594. Torso = Char["Torso"]
  595. Humanoid = Char["Humanoid"]
  596. LA = Char["Left Arm"]
  597. RA = Char["Right Arm"]
  598. LL = Char["Left Leg"]
  599. RL = Char["Right Leg"]
  600.  
  601. OrigLS = Torso["Left Shoulder"]
  602. OrigRS = Torso["Right Shoulder"]
  603.  
  604. for _,v in pairs(Char:GetChildren()) do
  605. if v.Name == ModID then
  606. v:Destroy()
  607. end
  608. end
  609.  
  610. for _,v in pairs(PlrGui:GetChildren()) do
  611. if v.Name == "PadsGui" then
  612. v:Destroy()
  613. end
  614. end
  615.  
  616. LS = Instance.new("Weld")
  617. RS = Instance.new("Weld")
  618.  
  619. LS.Name = OrigLS.Name
  620. LS.Part0 = Torso
  621. LS.Part1 = LA
  622. LS.C0 = LS0
  623. LS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
  624.  
  625. RS.Name = OrigRS.Name
  626. RS.Part0 = Torso
  627. RS.Part1 = RA
  628. RS.C0 = RS0
  629. RS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
  630.  
  631. local Pads = MakePads()
  632. local LPad = Pads.LBase
  633. local RPad = Pads.RBase
  634.  
  635. weldModel(LPad, true, LPad)
  636. weldModel(RPad, true, RPad)
  637.  
  638. local GripWeldL = Instance.new("Weld")
  639. GripWeldL.Name = "GripWeldL"
  640. GripWeldL.Part0 = LA
  641. GripWeldL.Part1 = LPad
  642. GripWeldL.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
  643. GripWeldL.Parent = LA
  644.  
  645. local GripWeldR = Instance.new("Weld")
  646. GripWeldR.Name = "GripWeldR"
  647. GripWeldR.Part0 = RA
  648. GripWeldR.Part1 = RPad
  649. GripWeldR.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
  650. GripWeldR.Parent = RA
  651.  
  652. local isParts = false
  653.  
  654. table.insert(Cons, Mouse.KeyDown:connect(function(Key)
  655. Key = Key:lower()
  656. if Key == "z" then
  657. --Stuff
  658. elseif Key == "f" then
  659. local Current = Current.Part
  660. if Current and Current.Parent ~= nil and not Multi then
  661. Current:BreakJoints()
  662. end
  663. elseif Key == "q" then
  664. if isParts then
  665. isParts = false
  666. for _,v in pairs(Workspace:GetChildren()) do
  667. if v.Name == "MyPartV" and v:IsA("BasePart") then
  668. v:Destroy()
  669. end
  670. end
  671. else
  672. isParts = true
  673. for i = 1, 50 do
  674. local Part = Instance.new("Part")
  675. Part.Color = Color3.new(math.random(), math.random(), math.random())
  676. Part.Transparency = 0
  677. Part.Size = Vector3.new(math.random(1, 3), math.random(1, 3), math.random(1, 3))
  678. Part.Archivable = true
  679. Part.CanCollide = false
  680. Part.Material = "Plastic"
  681. Part.Locked = false
  682. Part.CFrame = Torso.CFrame * CFrame.new(math.random(-15, 15), -1, math.random(-15, 15))
  683. Part.Anchored = true
  684. Part.Name = "MyPartV"
  685. Part.TopSurface = "Smooth"
  686. Part.BottomSurface = "Smooth"
  687. Part.Parent = Workspace
  688. end
  689. end
  690. elseif Key == "e" then
  691. local Targ;
  692. if Current.Part and Current.Part ~= nil then
  693. Targ = getTargFromCurrent()
  694. else
  695. Targ = LastPart
  696. end
  697. if Targ and Targ.Parent ~= nil and not Multi then
  698. local Ex = Instance.new("Explosion", Workspace)
  699. Ex.Position = Targ.CFrame.p
  700. Ex.BlastRadius = 16
  701. Ex.DestroyJointRadiusPercent = 0.5
  702. game.Players.Targ.ForceField:Destroy()
  703. end
  704. elseif Key == "c" then
  705. if Current.Part and Current.Part.Parent ~= nil and not Multi then
  706. local Part = getTargFromCurrent()
  707. if Part then
  708. Grabbing = false
  709. if Mouse.Hit then
  710. local TargPos = CFrame.new(Camera.CoordinateFrame.p, Mouse.Hit.p) * CFrame.new(0, 0, -1000)
  711. Fire(Part, TargPos.p)
  712. else
  713. Fire(Part, Mouse.Origin.p + Mouse.UnitRay.Direction, true)
  714. end
  715. end
  716. end
  717. end
  718. end))
  719.  
  720. table.insert(Cons, Mouse.Button1Up:connect(function()
  721. mDown = false
  722. if Grabbing == true and Multi == false then
  723. Grabbing = false
  724. Reset()
  725. end
  726. if Current.Part ~= nil then
  727. LastPart = getTargFromCurrent()
  728. Current = {}
  729. end
  730. end))
  731.  
  732. --[[
  733. local vel = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.Torso)
  734. vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * -5
  735. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  736. --]]
  737. --By Rufus14 (FINALLY I KNOW HOW TO MAKE A RAGDOLL :D)
  738. --die plz
  739. mouse = game.Players.LocalPlayer:GetMouse()
  740. function ragdoll()
  741. game.Players.LocalPlayer.Character.Archivable = true
  742. clone = game.Players.LocalPlayer.Character:Clone()
  743. clone.Parent = workspace
  744. for i,v in pairs(clone:GetChildren()) do
  745. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  746. v:destroy()
  747. end
  748. for i,p in pairs(v:GetChildren()) do
  749. if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  750. p:destroy()
  751. end
  752. end
  753. end
  754. for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  755. if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
  756. t:destroy()
  757. end
  758. end
  759. vel = Instance.new("BodyVelocity", clone.Torso)
  760. vel.Velocity = clone.Torso.CFrame.lookVector * -5
  761. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  762. clone.Head.face.Texture = "http://www.roblox.com/asset/?id=121559691"
  763. using = false
  764. hit = Instance.new("Sound", clone.Torso)
  765. hit.SoundId = "rbxassetid://546029423"
  766. hit.Volume = 5
  767. hit1 = Instance.new("Sound", clone.Torso)
  768. hit1.SoundId = "rbxassetid://138087186"
  769. hit1.Volume = 5
  770. hit2 = Instance.new("Sound", clone.Torso)
  771. hit2.SoundId = "rbxassetid://131237241"
  772. hit2.Volume = 5
  773. hit3 = Instance.new("Sound", clone.Torso)
  774. hit3.SoundId = "rbxassetid://278062209"
  775. hit3.Volume = 5
  776. hit3.TimePosition = 0.33
  777. ded = Instance.new("Sound", clone.Torso)
  778. ded.SoundId = "rbxassetid://345006204"
  779. ded.Volume = 10
  780. ded.TimePosition = 0
  781. local leftarm = clone:findFirstChild("Left Arm")
  782. local rightrm = clone:findFirstChild("Right Arm")
  783. local leftleg = clone:findFirstChild("Left Leg")
  784. local rightleg = clone:findFirstChild("Right Leg")
  785. local head = clone:findFirstChild("Head")
  786. local welding = Instance.new("Weld", clone.Torso)
  787. welding.Part0 = clone.Torso
  788. welding.Part1 = head
  789. welding.C0 = welding.C0 * CFrame.new(0,1.5,0)
  790. for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  791. if g.ClassName == "Part" then
  792. g:destroy()
  793. end
  794. end
  795. for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  796. if h.ClassName == "Accesory" then
  797. h:destroy()
  798. end
  799. end
  800. game.Workspace.CurrentCamera.CameraSubject = head
  801. if leftleg ~= nil then
  802. local glue = Instance.new("Glue", clone.Torso)
  803. glue.Part0 = clone.Torso
  804. glue.Part1 = leftleg
  805. glue.Name = "Left leg"
  806. local collider = Instance.new("Part", leftleg)
  807. collider.Position = Vector3.new(0,999,0)
  808. collider.Size = Vector3.new(1.7, 1, 1)
  809. collider.Shape = "Cylinder"
  810. local weld = Instance.new("Weld", collider)
  811. weld.Part0 = leftleg
  812. weld.Part1 = collider
  813. weld.C0 = CFrame.Angles(0, 0, 80)
  814. collider.TopSurface = "Smooth"
  815. collider.BottomSurface = "Smooth"
  816. collider.formFactor = "Symmetric"
  817. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  818. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  819. collider.Transparency = 1
  820. end
  821. ------------
  822. if rightleg ~= nil then
  823. local glue1 = Instance.new("Glue", clone.Torso)
  824. glue1.Part0 = clone.Torso
  825. glue1.Part1 = rightleg
  826. glue1.Name = "Right leg"
  827. local collider1 = Instance.new("Part", rightleg)
  828. collider1.Position = Vector3.new(0,999,0)
  829. collider1.Size = Vector3.new(1.7, 1, 1)
  830. collider1.Shape = "Cylinder"
  831. local weld1 = Instance.new("Weld", collider1)
  832. weld1.Part0 = rightleg
  833. weld1.Part1 = collider1
  834. weld1.C0 = CFrame.Angles(0, 0, 80)
  835. collider1.TopSurface = "Smooth"
  836. collider1.BottomSurface = "Smooth"
  837. collider1.formFactor = "Symmetric"
  838. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  839. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  840. collider1.Transparency = 1
  841. end
  842. ------------
  843. if rightrm ~= nil then
  844. local glue11 = Instance.new("Glue", clone.Torso)
  845. glue11.Part0 = clone.Torso
  846. glue11.Part1 = rightrm
  847. glue11.Name = "Right shoulder"
  848. local collider11 = Instance.new("Part", rightrm)
  849. collider11.Position = Vector3.new(0,9999,0)
  850. collider11.Size = Vector3.new(1.8,1,1)
  851. collider11.Shape = "Cylinder"
  852. local weld11 = Instance.new("Weld", collider11)
  853. weld11.Part0 = rightrm
  854. weld11.Part1 = collider11
  855. weld11.C0 = CFrame.Angles(0, 0, 80)
  856. collider11.TopSurface = "Smooth"
  857. collider11.BottomSurface = "Smooth"
  858. collider11.formFactor = "Symmetric"
  859. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  860. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  861. collider11.Transparency = 1
  862. end
  863. ------------
  864. if leftarm ~= nil then
  865. local glue111 = Instance.new("Glue", clone.Torso)
  866. glue111.Part0 = clone.Torso
  867. glue111.Part1 = leftarm
  868. glue111.Name = "Left shoulder"
  869. local collider111 = Instance.new("Part", leftarm)
  870. collider111.Position = Vector3.new(0,9999,0)
  871. collider111.Size = Vector3.new(1.8,1,1)
  872. collider111.Shape = "Cylinder"
  873. local weld111 = Instance.new("Weld", collider111)
  874. weld111.Part0 = leftarm
  875. weld111.Part1 = collider111
  876. weld111.C0 = CFrame.Angles(0, 0, 80)
  877. collider111.TopSurface = "Smooth"
  878. collider111.BottomSurface = "Smooth"
  879. collider111.formFactor = "Symmetric"
  880. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  881. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  882. collider111.Transparency = 1
  883. ----------------
  884. sensoring = Instance.new("Part", clone.Torso)
  885. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  886. sensoring.CanCollide = false
  887. sensoring.Position = clone.Torso.Position
  888. local welder = Instance.new("Weld", sensoring)
  889. welder.Part0 = clone.Torso
  890. welder.Part1 = sensoring
  891. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  892. sensoring.Transparency = 1
  893. -----------------
  894. sensoring1 = Instance.new("Part", clone.Torso)
  895. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  896. sensoring1.CanCollide = false
  897. sensoring1.Position = clone.Torso.Position
  898. local welder1 = Instance.new("Weld", sensoring)
  899. welder1.Part0 = clone.Torso
  900. welder1.Part1 = sensoring1
  901. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  902. sensoring1.Transparency = 1
  903. end
  904. clone.Name = game.Players.LocalPlayer.Character.Name.." (Ded? ;^;)"
  905. ded:Play()
  906. vel:destroy()
  907. wait(0.5)
  908. local function touch()
  909. if not using then
  910. using = true
  911. local Math = math.random(1,4)
  912. if Math == 1 then
  913. hit:Play()
  914. end
  915. if Math == 2 then
  916. hit1:Play()
  917. end
  918. if Math == 3 then
  919. hit2:Play()
  920. end
  921. if Math == 4 then
  922. hit3:Play()
  923. end
  924. wait(0.1)
  925. using = false
  926. end
  927. end
  928. sensoring.Touched:connect(touch)
  929. sensoring1.Touched:connect(touch)
  930. wait(4.47)
  931. hit1.Volume = 0
  932. hit2.Volume = 0
  933. hit3.Volume = 0
  934. hit.Volume = 0
  935. end
  936.  
  937. game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll)
  938.  
  939. --di ent
  940.  
  941.  
  942. local function makeLightning(Par, Start, End, Width, Length, RandomScale, ArcScale, Num1)
  943. local oldParts = {}
  944. for _,v in pairs(Par:GetChildren()) do
  945. v.CFrame = CFrame.new(5e5, 5e5, 5e5)
  946. table.insert(oldParts, v)
  947. end
  948. local Distance = (Start-End).Magnitude
  949. local ArcScale = ArcScale or 1
  950. local RandomScale = RandomScale or 0
  951. local Last = Start
  952. local IterNum = 0
  953.  
  954. while Par.Parent do
  955. IterNum = IterNum + 1
  956. local New = nil
  957. if (Last-End).Magnitude < Length then
  958. New = CFrame.new(End)
  959. else
  960. if (End-Last).Magnitude < Length*2 then
  961. RandomScale = RandomScale*0.5
  962. ArcScale = ArcScale*0.5
  963. end
  964. local Direct = CFrame.new(Last,End)
  965. New = Direct*CFrame.Angles(math.rad(math.random(-RandomScale/4,RandomScale*ArcScale)),math.rad(math.random(-RandomScale,RandomScale)),math.rad(math.random(-RandomScale,RandomScale)))
  966. New = New*CFrame.new(0,0,-Length)
  967. end
  968. local Trail = nil
  969. if oldParts[IterNum] then
  970. Trail = oldParts[IterNum]
  971. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Crimson")) or BrickColor.new("Really black")
  972. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  973. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  974. oldParts[IterNum] = nil
  975. else
  976. Trail = Instance.new("Part")
  977. Trail.Name = "Part"
  978. Trail.FormFactor = "Custom"
  979. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Crimson")) or BrickColor.new("Really black")
  980. Trail.Transparency = 0
  981. Trail.Anchored = true
  982. Trail.CanCollide = false
  983. Trail.Locked = true
  984. Trail.BackSurface = "SmoothNoOutlines"
  985. Trail.BottomSurface = "SmoothNoOutlines"
  986. Trail.FrontSurface = "SmoothNoOutlines"
  987. Trail.LeftSurface = "SmoothNoOutlines"
  988. Trail.RightSurface = "SmoothNoOutlines"
  989. Trail.TopSurface = "SmoothNoOutlines"
  990. Trail.Material = "Neon"
  991. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  992. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  993. Trail.Parent = Par
  994. end
  995. Last = New.p
  996. if (Last-End).Magnitude < 1 then
  997. break
  998. end
  999. end
  1000. for _,v in pairs(oldParts) do
  1001. v:Destroy()
  1002. end
  1003. end
  1004.  
  1005. table.insert(Cons, Mouse.Button1Down:connect(function()
  1006. mDown = true
  1007. local Targ = Mouse.Target
  1008. Cor(function()
  1009. if Targ and Objects[Targ] and not Multi then
  1010. Grabbing = true
  1011. Current.Part = Targ
  1012. local Mass = Objects[Targ]
  1013. local ForceNum = 0
  1014. local Hum = nil
  1015.  
  1016. for _,v in pairs(Targ:GetChildren()) do
  1017. if BodyObjects[v.ClassName] then
  1018. v:Destroy()
  1019. end
  1020. end
  1021.  
  1022. for _,v in pairs(Workspace:GetChildren()) do
  1023. if v:findFirstChild("Humanoid") and v:IsAncestorOf(Targ) then
  1024. Hum = v.Humanoid
  1025. Mass = getMass(v, 0)
  1026. Current.Part = v
  1027. break
  1028. end
  1029. end
  1030.  
  1031. Current.Mass = Mass
  1032.  
  1033. if not Hum then
  1034. Targ:BreakJoints()
  1035. end
  1036.  
  1037. ForceNum = Mass * Grav
  1038. Targ.CanCollide = true
  1039. Targ.Anchored = false
  1040.  
  1041. local BP = Instance.new("BodyPosition")
  1042. BP.maxForce = Vector3.new(3 * ForceNum, 3 * ForceNum, 3 * ForceNum)
  1043. BP.Parent = Targ
  1044.  
  1045. local Ang = Instance.new("BodyAngularVelocity")
  1046. Ang.Parent = Targ
  1047.  
  1048. Current.BP = BP
  1049. Current.BA = Ang
  1050.  
  1051. OrigLS.Parent = nil
  1052. OrigRS.Parent = nil
  1053.  
  1054. LS.Parent = Torso
  1055. RS.Parent = Torso
  1056.  
  1057. LS.C0 = LS0
  1058. RS.C0 = RS0
  1059.  
  1060. local DirDot = Mouse.UnitRay.Direction:Dot(Targ.Position - Mouse.Origin.p)
  1061. local BPPos = Vector3.new(0, 0, 0)
  1062. local Vel = Vector3.new(0, 0, 0)
  1063. local Vlev = random() * math.pi
  1064. local RPos = Vector3.new(random() * 2 - 1, cos(Vlev), random() * 2 - 1)
  1065.  
  1066. local Ball = Instance.new("Part")
  1067. Ball.Name = "Ball"
  1068. Ball.FormFactor = "Custom"
  1069. Ball.Color = Color3.new(255, 0, 0)
  1070. Ball.Transparency = 0.3
  1071. Ball.Anchored = true
  1072. Ball.CanCollide = false
  1073. Ball.Locked = true
  1074. Ball.BottomSurface, Ball.TopSurface = "Smooth", "Smooth"
  1075. Ball.Size = Vector3.new(0.5, 0.5, 0.5)
  1076. Ball.CFrame = Torso.CFrame * CFrame.new(0, 1, -3)
  1077. Ball.Parent = Char
  1078.  
  1079. if Targ.Name == "MyPartV" then
  1080. Targ.Name = "MyPartF"
  1081. end
  1082.  
  1083. local LightMod = Instance.new("Model", Char)
  1084.  
  1085. local Mesh = Instance.new("SpecialMesh")
  1086. Mesh.MeshType = "Sphere"
  1087. Mesh.Parent = Ball
  1088.  
  1089. local Size = 1
  1090. local Rise = true
  1091.  
  1092. while Grabbing and BP and Ang and Targ.Parent ~= nil do
  1093. local BPPos = Mouse.Origin.p + Mouse.UnitRay.Direction * DirDot
  1094. Ang.angularvelocity = Vel
  1095. BP.position = BPPos + RPos
  1096. RPos = Vector3.new(max(-1, min(RPos.x + random() * 0.02 - 0.01, 1)), cos(Vlev), max(-1, min(RPos.z + random() * 0.02 - 0.01, 1)))
  1097. Vel = Vector3.new(max(-1, min(Vel.x + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.y + random() * 0.2 - 0.1, 1)), max(-1, min(Vel.z + random() * 0.2 - 0.1, 1)))
  1098. Vlev = (Vlev + 0.05) % tau
  1099.  
  1100. if Hum then
  1101. Hum.Sit = true
  1102. end
  1103.  
  1104. if LA.Parent ~= nil and RA.Parent ~= nil then
  1105. local LPos = (LA.CFrame * CFrame.new(0, -1, 0)).p
  1106. local RPos = (RA.CFrame * CFrame.new(0, -1, 0)).p
  1107. if Rise == true then
  1108. if Size < 0.6 then
  1109. Size = Size + 0.05
  1110. else
  1111. Size = Size + 0.1
  1112. end
  1113. if Size >= 2.2 then
  1114. Rise = false
  1115. end
  1116. else
  1117. if Size > 2.1 then
  1118. Size = Size - 0.05
  1119. else
  1120. Size = Size - 0.1
  1121. end
  1122. if Size <= 0.5 then
  1123. Rise = true
  1124. end
  1125. end
  1126. Ball.Size = Vector3.new(Size, Size, Size)
  1127. Ball.CFrame = CFrame.new(LPos:Lerp(RPos, 0.5), Targ.Position) * CFrame.new(0, 0, -2.2)
  1128. LightNum = LightNum + 1
  1129. makeLightning(LightMod, Ball.Position, Targ.Position, 0.2, 4, 50, 1, LightNum)
  1130. elseif Ball.Parent ~= nil then
  1131. Ball:Destroy()
  1132. end
  1133.  
  1134. if LS and LS.Parent == Torso then
  1135. LS.C0 = CFrame.new(Vector3.new(-1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(-1.5, 0.5, 1)).p))
  1136. end
  1137. if RS and RS.Parent == Torso then
  1138. RS.C0 = CFrame.new(Vector3.new(1.5, 0.5, 0), Torso.CFrame:pointToObjectSpace((Targ.CFrame or Torso.CFrame * CFrame.new(1.5, 0.5, 1)).p))
  1139. end
  1140. RunService.Heartbeat:wait()
  1141. end
  1142.  
  1143. coroutine.resume(coroutine.create(function()
  1144. for i = 0.5, 1, 0.1 do
  1145. for i2,v in pairs(LightMod:GetChildren()) do
  1146. --v.Light.Range = 6-(i*5)
  1147. v.Transparency = i
  1148. end
  1149. wait(1/30)
  1150. end
  1151. LightMod:Destroy()
  1152. end))
  1153.  
  1154. if BP and BP.Parent ~= nil then
  1155. BP:Destroy()
  1156. end
  1157.  
  1158. if Ang and Ang.Parent ~= nil then
  1159. Ang:Destroy()
  1160. end
  1161.  
  1162. pcall(function() Ball:Destroy() end)
  1163. end
  1164. end)
  1165. end))
  1166. end)
  1167. end
  1168.  
  1169. function Add(Obj)
  1170. if Obj:IsA("BasePart") and not Objects[Obj] and not (Obj.Name == "Base" and Obj.ClassName == "Part") then
  1171. Objects[Obj] = Obj:GetMass()
  1172. Obj.Changed:connect(function(P)
  1173. if P:lower() == "size" and Objects[Obj] and Obj.Parent ~= nil then
  1174. Objects[Obj] = Obj:GetMass()
  1175. end
  1176. end)
  1177. end
  1178. end
  1179.  
  1180. function Rem(Obj)
  1181. if Objects[Obj] then
  1182. Objects[Obj] = nil
  1183. end
  1184. end
  1185.  
  1186. function Recursion(Obj)
  1187. ypcall(function()
  1188. Add(Obj)
  1189. if #Obj:GetChildren() > 0 then
  1190. for _,v in pairs(Obj:GetChildren()) do
  1191. Recursion(v)
  1192. end
  1193. end
  1194. end)
  1195. end
  1196.  
  1197. Workspace.DescendantAdded:connect(function(Obj)
  1198. Add(Obj)
  1199. end)
  1200.  
  1201. Workspace.DescendantRemoving:connect(function(Obj)
  1202. Rem(Obj)
  1203. end)
  1204.  
  1205. for _,v in pairs(Workspace:GetChildren()) do
  1206. Recursion(v)
  1207. end
  1208.  
  1209. Start()
  1210.  
  1211. if LP.Name == PlrName then
  1212. LP.CharacterAdded:connect(Start)
  1213. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement