Advertisement
NikieCoop12

Untitled

Jan 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. local function makeLightning(Par, Start, End, Width, Length, RandomScale, ArcScale, Num1)
  733. local oldParts = {}
  734. for _,v in pairs(Par:GetChildren()) do
  735. v.CFrame = CFrame.new(5e5, 5e5, 5e5)
  736. table.insert(oldParts, v)
  737. end
  738. local Distance = (Start-End).Magnitude
  739. local ArcScale = ArcScale or 1
  740. local RandomScale = RandomScale or 0
  741. local Last = Start
  742. local IterNum = 0
  743.  
  744. while Par.Parent do
  745. IterNum = IterNum + 1
  746. local New = nil
  747. if (Last-End).Magnitude < Length then
  748. New = CFrame.new(End)
  749. else
  750. if (End-Last).Magnitude < Length*2 then
  751. RandomScale = RandomScale*0.5
  752. ArcScale = ArcScale*0.5
  753. end
  754. local Direct = CFrame.new(Last,End)
  755. New = Direct*CFrame.Angles(math.rad(math.random(-RandomScale/4,RandomScale*ArcScale)),math.rad(math.random(-RandomScale,RandomScale)),math.rad(math.random(-RandomScale,RandomScale)))
  756. New = New*CFrame.new(0,0,-Length)
  757. end
  758. local Trail = nil
  759. if oldParts[IterNum] then
  760. Trail = oldParts[IterNum]
  761. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Royal purple")) or BrickColor.new("Green")
  762. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  763. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  764. oldParts[IterNum] = nil
  765. else
  766. Trail = Instance.new("Part")
  767. Trail.Name = "Part"
  768. Trail.FormFactor = "Custom"
  769. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Green")) or BrickColor.new("Royal purple")
  770. Trail.Transparency = 0
  771. Trail.Anchored = true
  772. Trail.CanCollide = false
  773. Trail.Locked = true
  774. Trail.BackSurface = "SmoothNoOutlines"
  775. Trail.BottomSurface = "SmoothNoOutlines"
  776. Trail.FrontSurface = "SmoothNoOutlines"
  777. Trail.LeftSurface = "SmoothNoOutlines"
  778. Trail.RightSurface = "SmoothNoOutlines"
  779. Trail.TopSurface = "SmoothNoOutlines"
  780. Trail.Material = "Neon"
  781. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  782. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  783. Trail.Parent = Par
  784. end
  785. Last = New.p
  786. if (Last-End).Magnitude < 1 then
  787. break
  788. end
  789. end
  790. for _,v in pairs(oldParts) do
  791. v:Destroy()
  792. end
  793. end
  794.  
  795. table.insert(Cons, Mouse.Button1Down:connect(function()
  796. mDown = true
  797. local Targ = Mouse.Target
  798. Cor(function()
  799. if Targ and Objects[Targ] and not Multi then
  800. Grabbing = true
  801. Current.Part = Targ
  802. local Mass = Objects[Targ]
  803. local ForceNum = 0
  804. local Hum = nil
  805.  
  806. for _,v in pairs(Targ:GetChildren()) do
  807. if BodyObjects[v.ClassName] then
  808. v:Destroy()
  809. end
  810. end
  811.  
  812. for _,v in pairs(Workspace:GetChildren()) do
  813. if v:findFirstChild("Humanoid") and v:IsAncestorOf(Targ) then
  814. Hum = v.Humanoid
  815. Mass = getMass(v, 0)
  816. Current.Part = v
  817. break
  818. end
  819. end
  820.  
  821. Current.Mass = Mass
  822.  
  823. if not Hum then
  824. Targ:BreakJoints()
  825. end
  826.  
  827. ForceNum = Mass * Grav
  828. Targ.CanCollide = true
  829. Targ.Anchored = false
  830.  
  831. local BP = Instance.new("BodyPosition")
  832. BP.maxForce = Vector3.new(3 * ForceNum, 3 * ForceNum, 3 * ForceNum)
  833. BP.Parent = Targ
  834.  
  835. local Ang = Instance.new("BodyAngularVelocity")
  836. Ang.Parent = Targ
  837.  
  838. Current.BP = BP
  839. Current.BA = Ang
  840.  
  841. OrigLS.Parent = nil
  842. OrigRS.Parent = nil
  843.  
  844. LS.Parent = Torso
  845. RS.Parent = Torso
  846.  
  847. LS.C0 = LS0
  848. RS.C0 = RS0
  849.  
  850. local DirDot = Mouse.UnitRay.Direction:Dot(Targ.Position - Mouse.Origin.p)
  851. local BPPos = Vector3.new(0, 0, 0)
  852. local Vel = Vector3.new(0, 0, 0)
  853. local Vlev = random() * math.pi
  854. local RPos = Vector3.new(random() * 2 - 1, cos(Vlev), random() * 2 - 1)
  855.  
  856. local Ball = Instance.new("Part")
  857. Ball.Name = "Ball"
  858. Ball.FormFactor = "Custom"
  859. Ball.Color = Color3.new(255, 0, 0)
  860. Ball.Transparency = 0.3
  861. Ball.Anchored = true
  862. Ball.CanCollide = false
  863. Ball.Locked = true
  864. Ball.BottomSurface, Ball.TopSurface = "Smooth", "Smooth"
  865. Ball.Size = Vector3.new(0.5, 0.5, 0.5)
  866. Ball.CFrame = Torso.CFrame * CFrame.new(0, 1, -3)
  867. Ball.Parent = Char
  868.  
  869. if Targ.Name == "MyPartV" then
  870. Targ.Name = "MyPartF"
  871. end
  872.  
  873. local LightMod = Instance.new("Model", Char)
  874.  
  875. local Mesh = Instance.new("SpecialMesh")
  876. Mesh.MeshType = "Sphere"
  877. Mesh.Parent = Ball
  878.  
  879. local Size = 1
  880. local Rise = true
  881.  
  882. while Grabbing and BP and Ang and Targ.Parent ~= nil do
  883. local BPPos = Mouse.Origin.p + Mouse.UnitRay.Direction * DirDot
  884. Ang.angularvelocity = Vel
  885. BP.position = BPPos + RPos
  886. 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)))
  887. 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)))
  888. Vlev = (Vlev + 0.05) % tau
  889.  
  890. if Hum then
  891. Hum.Sit = true
  892. end
  893.  
  894. if LA.Parent ~= nil and RA.Parent ~= nil then
  895. local LPos = (LA.CFrame * CFrame.new(0, -1, 0)).p
  896. local RPos = (RA.CFrame * CFrame.new(0, -1, 0)).p
  897. if Rise == true then
  898. if Size < 0.6 then
  899. Size = Size + 0.05
  900. else
  901. Size = Size + 0.1
  902. end
  903. if Size >= 2.2 then
  904. Rise = false
  905. end
  906. else
  907. if Size > 2.1 then
  908. Size = Size - 0.05
  909. else
  910. Size = Size - 0.1
  911. end
  912. if Size <= 0.5 then
  913. Rise = true
  914. end
  915. end
  916. Ball.Size = Vector3.new(Size, Size, Size)
  917. Ball.CFrame = CFrame.new(LPos:Lerp(RPos, 0.5), Targ.Position) * CFrame.new(0, 0, -2.2)
  918. LightNum = LightNum + 1
  919. makeLightning(LightMod, Ball.Position, Targ.Position, 0.2, 4, 50, 1, LightNum)
  920. elseif Ball.Parent ~= nil then
  921. Ball:Destroy()
  922. end
  923.  
  924. if LS and LS.Parent == Torso then
  925. 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))
  926. end
  927. if RS and RS.Parent == Torso then
  928. 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))
  929. end
  930. RunService.Heartbeat:wait()
  931. end
  932.  
  933. coroutine.resume(coroutine.create(function()
  934. for i = 0.5, 1, 0.1 do
  935. for i2,v in pairs(LightMod:GetChildren()) do
  936. --v.Light.Range = 6-(i*5)
  937. v.Transparency = i
  938. end
  939. wait(1/30)
  940. end
  941. LightMod:Destroy()
  942. end))
  943.  
  944. if BP and BP.Parent ~= nil then
  945. BP:Destroy()
  946. end
  947.  
  948. if Ang and Ang.Parent ~= nil then
  949. Ang:Destroy()
  950. end
  951.  
  952. pcall(function() Ball:Destroy() end)
  953. end
  954. end)
  955. end))
  956. end)
  957. end
  958.  
  959. function Add(Obj)
  960. if Obj:IsA("BasePart") and not Objects[Obj] and not (Obj.Name == "Base" and Obj.ClassName == "Part") then
  961. Objects[Obj] = Obj:GetMass()
  962. Obj.Changed:connect(function(P)
  963. if P:lower() == "size" and Objects[Obj] and Obj.Parent ~= nil then
  964. Objects[Obj] = Obj:GetMass()
  965. end
  966. end)
  967. end
  968. end
  969.  
  970. function Rem(Obj)
  971. if Objects[Obj] then
  972. Objects[Obj] = nil
  973. end
  974. end
  975.  
  976. function Recursion(Obj)
  977. ypcall(function()
  978. Add(Obj)
  979. if #Obj:GetChildren() > 0 then
  980. for _,v in pairs(Obj:GetChildren()) do
  981. Recursion(v)
  982. end
  983. end
  984. end)
  985. end
  986.  
  987. Workspace.DescendantAdded:connect(function(Obj)
  988. Add(Obj)
  989. end)
  990.  
  991. Workspace.DescendantRemoving:connect(function(Obj)
  992. Rem(Obj)
  993. end)
  994.  
  995. for _,v in pairs(Workspace:GetChildren()) do
  996. Recursion(v)
  997. end
  998.  
  999. Start()
  1000.  
  1001. if LP.Name == PlrName then
  1002. LP.CharacterAdded:connect(Start)
  1003. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement