refrop

Ultra telekinesis v3

Apr 28th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.99 KB | None | 0 0
  1. --edited by refrop
  2.  
  3. local s = Instance.new("Sound")
  4.  
  5. s.Name = "Sound"
  6. s.SoundId = "http://www.roblox.com/asset/?id=155722789"
  7. s.Volume = 70
  8. s.Looped = false
  9. s.archivable = false
  10.  
  11. s.Parent = game.Workspace
  12.  
  13. wait(3)
  14.  
  15. s:play()
  16. local isScriptNil = false
  17.  
  18. local PlrName = "refrop" --------put your name here
  19. local Plrs = game:GetService("Players")
  20. local RunService = game:GetService("RunService")
  21. local Content = game:GetService("ContentProvider")
  22. local LP = Plrs.LocalPlayer
  23. local Char = LP.Character
  24. local PlrGui = LP.PlayerGui
  25. local Backpack = LP.Backpack
  26. local Mouse = LP:GetMouse()
  27.  
  28. local Camera = Workspace.CurrentCamera
  29. local LastCamCF = Camera.CoordinateFrame
  30. local AnimJoints = {}
  31. local Cons = {}
  32. local mDown = false
  33. local Multi = false
  34. local Grabbing = false
  35. local Current = {}
  36. local Alpha = 1
  37. local LightNum = 1
  38.  
  39. Current.Part = nil
  40. Current.BP = nil
  41. Current.BA = nil
  42. Current.Mass = nil
  43.  
  44. local LastPart = nil
  45.  
  46. local Head = Char["Head"]
  47. local Torso = Char["Torso"]
  48. local Humanoid = Char["Humanoid"]
  49. local LA = Char["Left Arm"]
  50. local RA = Char["Right Arm"]
  51. local LL = Char["Left Leg"]
  52. local RL = Char["Right Leg"]
  53.  
  54. local LS, RS;
  55.  
  56. local OrigLS = Torso["Left Shoulder"]
  57. local OrigRS = Torso["Right Shoulder"]
  58.  
  59. for _,v in pairs(Char:GetChildren()) do
  60. if v.Name == ModID then
  61. v:Destroy()
  62. end
  63. end
  64.  
  65. for _,v in pairs(PlrGui:GetChildren()) do
  66. if v.Name == "PadsGui" then
  67. v:Destroy()
  68. end
  69. end
  70.  
  71. local ModID = "Pads"
  72. local Objects = {}
  73. local Grav = 196.2
  74.  
  75. local sin=math.sin
  76. local cos=math.cos
  77. local max=math.max
  78. local min=math.min
  79. local atan2=math.atan2
  80. local random=math.random
  81. local tau = 2 * math.pi
  82.  
  83. local BodyObjects = {
  84. ["BodyVelocity"] = true;
  85. ["BodyAngularVelocity"] = true;
  86. ["BodyForce"] = true;
  87. ["BodyThrust"] = true;
  88. ["BodyPosition"] = true;
  89. ["RocketPropulsion"] = true;
  90. }
  91.  
  92. if LP.Name == PlrName and isScriptNil then
  93. script.Parent = nil
  94. end
  95.  
  96. LP.CameraMode = "Classic"
  97.  
  98. local Assets = {
  99. }
  100.  
  101. local LS0, LS1 = OrigLS.C0, OrigLS.C1
  102. local RS0, RS1 = OrigRS.C0, OrigRS.C1
  103.  
  104. for i,v in pairs(Assets) do
  105. local ID = tostring(Assets[i])
  106. Assets[i] = "http://www.roblox.com/asset/?id=" .. ID
  107. Content:Preload("http://www.roblox.com/asset/?id=" .. ID)
  108. end
  109.  
  110. function QuaternionFromCFrame(cf)
  111. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components();
  112. local trace = m00 + m11 + m22 if trace > 0 then
  113. local s = math.sqrt(1 + trace);
  114. local recip = 0.5/s;
  115. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5;
  116. else
  117. local i = 0;
  118. if m11 > m00 then
  119. i = 1;
  120. end;
  121. if m22 > (i == 0 and m00 or m11) then
  122. i = 2 end if i == 0 then
  123. local s = math.sqrt(m00-m11-m22+1);
  124. local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip;
  125. elseif i == 1 then
  126. local s = math.sqrt(m11-m22-m00+1);
  127. local recip = 0.5/s;
  128. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip ;
  129. elseif i == 2 then
  130. local s = math.sqrt(m22-m00-m11+1);
  131. local recip = 0.5/s;
  132. return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip;
  133. end;
  134. end;
  135. end;
  136.  
  137. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  138. local xs, ys, zs = x + x, y + y, z + z;
  139. local wx, wy, wz = w*xs, w*ys, w*zs;
  140. local xx = x*xs;
  141. local xy = x*ys;
  142. local xz = x*zs;
  143. local yy = y*ys;
  144. local yz = y*zs;
  145. local zz = z*zs;
  146. 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))
  147. end;
  148.  
  149. function QuaternionSlerp(a, b, t)
  150. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4];
  151. local startInterp, finishInterp;
  152. if cosTheta >= 0.0001 then
  153. if (1 - cosTheta) > 0.0001 then
  154. local theta = math.acos(cosTheta);
  155. local invSinTheta = 1/math.sin(theta);
  156. startInterp = math.sin((1-t)*theta)*invSinTheta;
  157. finishInterp = math.sin(t*theta)*invSinTheta;
  158. else
  159. startInterp = 1-t finishInterp = t;
  160. end;
  161. else
  162. if (1+cosTheta) > 0.0001 then
  163. local theta = math.acos(-cosTheta);
  164. local invSinTheta = 1/math.sin(theta);
  165. startInterp = math.sin((t-1)*theta)*invSinTheta;
  166. finishInterp = math.sin(t*theta)*invSinTheta;
  167. else startInterp = t-1 finishInterp = t;
  168. end;
  169. end;
  170. 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;
  171. end;
  172.  
  173. function CLerp(a,b,t)
  174. local qa={QuaternionFromCFrame(a)};
  175. local qb={QuaternionFromCFrame(b)};
  176. local ax,ay,az=a.x,a.y,a.z;
  177. local bx,by,bz=b.x,b.y,b.z;
  178. local _t=1-t;
  179. return QuaternionToCFrame(_t*ax+t*bx,_t*ay+t*by,_t*az+t*bz,QuaternionSlerp(qa, qb, t));
  180. end
  181.  
  182. function GetWeld(weld)
  183. local obj
  184. for i, v in pairs(AnimJoints) do
  185. if v[1] == weld then
  186. obj = v
  187. break
  188. end
  189. end
  190. if not obj then
  191. obj = {weld,NV}
  192. table.insert(AnimJoints,obj)
  193. end
  194. return weld.C0.p, obj[2]
  195. end
  196.  
  197. function SetWeld(weld, i, loops, origpos, origangle, nextpos, nextangle, override, overrideLower, smooth)
  198. smooth = smooth or 1
  199. local obj
  200. for i, v in pairs(AnimJoints) do
  201. if v[1] == weld then
  202. obj = v
  203. break
  204. end
  205. end
  206. if not obj then
  207. obj = {weld,NV}
  208. table.insert(AnimJoints,obj)
  209. end
  210.  
  211. local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
  212.  
  213. local tox,toy,toz = 0,0,0
  214. tox = math.abs(origangle.x - nextangle.x) *perc
  215. toy = math.abs(origangle.y - nextangle.y) *perc
  216. toz = math.abs(origangle.z - nextangle.z) *perc
  217. tox = ((origangle.x > nextangle.x and -tox) or tox)
  218. toy = ((origangle.y > nextangle.y and -toy) or toy)
  219. toz = ((origangle.z > nextangle.z and -toz) or toz)
  220.  
  221. local tox2,toy2,toz2 = 0,0,0
  222. tox2 = math.abs(origpos.x - nextpos.x) *perc
  223. toy2 = math.abs(origpos.y - nextpos.y) *perc
  224. toz2 = math.abs(origpos.z - nextpos.z) *perc
  225. tox2 = (origpos.x > nextpos.x and -tox2) or tox2
  226. toy2 = (origpos.y > nextpos.y and -toy2) or toy2
  227. toz2 = (origpos.z > nextpos.z and -toz2) or toz2
  228.  
  229. obj[2] = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  230. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  231. end
  232.  
  233. function RotateCamera(x, y)
  234. 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)
  235. end
  236.  
  237. function GetAngles(cf)
  238. local lv = cf.lookVector
  239. return -math.asin(lv.y), math.atan2(lv.x, -lv.z)
  240. end
  241.  
  242. local LastCamCF = Camera.CoordinateFrame
  243.  
  244. function Look()
  245. if AlphaOn == true then
  246. local x, y = GetAngles(LastCamCF:toObjectSpace(Camera.CoordinateFrame))
  247. Camera.CoordinateFrame = LastCamCF
  248. RotateCamera(x * -(Alpha), y * -(Alpha))
  249. LastCamCF = Camera.CoordinateFrame
  250. end
  251. end
  252.  
  253. function Cor(Func)
  254. local Ok, Err = coroutine.resume(coroutine.create(Func))
  255. if not Ok then
  256. print(Err)
  257. end
  258. end
  259.  
  260. function Cor2(Func)
  261. local Ok, Err = ypcall(Func)
  262. if not Ok then
  263. print(Err)
  264. end
  265. end
  266.  
  267. function MakePads()
  268. -- 1 - VTelekinesis
  269. P1 = Instance.new("Model")
  270. P1.Name = ModID
  271.  
  272. -- 2 - RBase
  273. P2 = Instance.new("Part")
  274. P2.CFrame = CFrame.new(Vector3.new(21.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
  275. P2.FormFactor = Enum.FormFactor.Custom
  276. P2.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
  277. P2.Anchored = true
  278. P2.BrickColor = BrickColor.new("Earth green")
  279. P2.Friction = 0.30000001192093
  280. P2.Shape = Enum.PartType.Block
  281. P2.Name = "RBase"
  282. P2.Parent = P1
  283. P2.Transparency = 1
  284. -- 3 - Mesh
  285. P3 = Instance.new("CylinderMesh")
  286. P3.Scale = Vector3.new(1, 0.5, 1)
  287. P3.Parent = P2
  288.  
  289. -- 4 - LBase
  290. P4 = Instance.new("Part")
  291. P4.CFrame = CFrame.new(Vector3.new(18.100008, 1.95000589, 11.899971)) * CFrame.Angles(-0, 0, -0)
  292. P4.FormFactor = Enum.FormFactor.Custom
  293. P4.Size = Vector3.new(0.799999952, 0.200000003, 0.800000012)
  294. P4.Anchored = true
  295. P4.BrickColor = BrickColor.new("Earth green")
  296. P4.Friction = 0.30000001192093
  297. P4.Shape = Enum.PartType.Block
  298. P4.Name = "LBase"
  299. P4.Parent = P1
  300. P4.Transparency = 1
  301. -- 5 - Mesh
  302. P5 = Instance.new("CylinderMesh")
  303. P5.Scale = Vector3.new(1, 0.5, 1)
  304. P5.Parent = P4
  305.  
  306. -- 7 - Mesh
  307. P7 = Instance.new("CylinderMesh")
  308. P7.Scale = Vector3.new(1, 0.5, 1)
  309. P7.Parent = P6
  310.  
  311.  
  312.  
  313. -- 9 - Mesh
  314. P9 = Instance.new("CylinderMesh")
  315. P9.Scale = Vector3.new(1, 0.5, 1)
  316. P9.Parent = P8
  317.  
  318.  
  319.  
  320. -- 11 - Mesh
  321. P11 = Instance.new("CylinderMesh")
  322. P11.Scale = Vector3.new(1, 0.5, 1)
  323. P11.Parent = P10
  324.  
  325.  
  326. -- 13 - Mesh
  327. P13 = Instance.new("CylinderMesh")
  328. P13.Scale = Vector3.new(1, 0.5, 1)
  329. P13.Parent = P12
  330.  
  331.  
  332. -- 15 - Mesh
  333. P15 = Instance.new("CylinderMesh")
  334. P15.Scale = Vector3.new(1, 0.5, 1)
  335. P15.Parent = P14
  336.  
  337. -- 17 - Mesh
  338. P17 = Instance.new("CylinderMesh")
  339. P17.Scale = Vector3.new(1, 0.5, 1)
  340. P17.Parent = P16
  341.  
  342. P1.Parent = LP.Character
  343. P1:MakeJoints()
  344. return P1
  345. end
  346.  
  347. weldModel = function(model, unanchor, rooty)
  348. local parts = {}
  349. local function recurse(object)
  350. if object:IsA("BasePart") then
  351. table.insert(parts, object)
  352. end
  353. for _,child in pairs(object:GetChildren()) do
  354. recurse(child)
  355. end
  356. end
  357. recurse(model)
  358.  
  359. local rootPart = rooty or parts[1]
  360. for _, part in pairs(parts) do
  361. local cframe = rootPart.CFrame:toObjectSpace(part.CFrame)
  362. local weld = Instance.new("Weld")
  363. weld.Part0 = rootPart
  364. weld.Part1 = part
  365. weld.C0 = cframe
  366. weld.Parent = rootPart
  367. end
  368.  
  369. if unanchor then
  370. for _, part in pairs(parts) do
  371. part.Anchored = false
  372. part.CanCollide = false
  373. end
  374. end
  375. end
  376.  
  377. weldItem = function(rootPart, Item, TheC0, unanchor, ParentItem)
  378. local cframe = TheC0 or rootPart.CFrame:toObjectSpace(Item.CFrame)
  379. local weld = Instance.new("Weld")
  380. weld.Name = "Weld"
  381. weld.Part0 = rootPart
  382. weld.Part1 = Item
  383. weld.C0 = cframe
  384. weld.Parent = ParentItem and Item or rootPart
  385.  
  386. if unanchor then
  387. Item.Anchored = false
  388. end
  389. return weld, cframe
  390. end
  391.  
  392. scaleModel = function(model, scale)
  393. local parts = {}
  394. local function recurse(object)
  395. if object:IsA("BasePart") then
  396. table.insert(parts, object)
  397. end
  398. for _,child in pairs(object:GetChildren()) do
  399. recurse(child)
  400. end
  401. end
  402. recurse(model)
  403.  
  404. local top, bottom, left, right, back, front
  405. for _, part in pairs(parts) do
  406. if top == nil or top < part.Position.y then top = part.Position.y end
  407. if bottom == nil or bottom > part.Position.y then bottom = part.Position.y end
  408. if left == nil or left > part.Position.x then left = part.Position.x end
  409. if right == nil or right < part.Position.x then right = part.Position.x end
  410. if back == nil or back > part.Position.z then back = part.Position.z end
  411. if front == nil or front < part.Position.z then front = part.Position.z end
  412. end
  413.  
  414. local middle = Vector3.new( left+right, top+bottom, back+front )/2
  415. local minSize = Vector3.new(0.2, 0.2, 0.2)
  416.  
  417. for _, part in pairs(parts) do
  418. local foo = part.CFrame.p - middle
  419. local rotation = part.CFrame - part.CFrame.p
  420. local newSize = part.Size*scale
  421. part.FormFactor = "Custom"
  422. part.Size = newSize
  423. part.CFrame = CFrame.new( middle + foo*scale ) * rotation
  424.  
  425. if newSize.x < minSize.x or newSize.y < minSize.y or newSize.z < minSize.z then
  426. local mesh
  427. for _, child in pairs(part:GetChildren()) do
  428. if child:IsA("DataModelMesh") then
  429. mesh = child
  430. break
  431. end
  432. end
  433.  
  434. if mesh == nil then
  435. mesh = Instance.new("BlockMesh", part)
  436. end
  437.  
  438. local oScale = mesh.Scale
  439. local newScale = newSize/minSize * oScale
  440. if 0.2 < newSize.x then newScale = Vector3.new(1 * oScale.x, newScale.y, newScale.z) end
  441. if 0.2 < newSize.y then newScale = Vector3.new(newScale.x, 1 * oScale.y, newScale.z) end
  442. if 0.2 < newSize.z then newScale = Vector3.new(newScale.x, newScale.y, 1 * oScale.z) end
  443.  
  444. mesh.Scale = newScale
  445. end
  446. end
  447. end
  448.  
  449. function getMass(Obj, Total)
  450. local newTotal = Total
  451. local returnTotal = 0
  452.  
  453. if Obj:IsA("BasePart") then
  454. newTotal = newTotal + Objects[Obj]
  455. elseif BodyObjects[Obj.ClassName] then
  456. Obj:Destroy()
  457. end
  458.  
  459. if Obj:GetChildren() and #Obj:GetChildren() > 0 then
  460. for _,v in pairs(Obj:GetChildren()) do
  461. returnTotal = returnTotal + getMass(v, newTotal)
  462. end
  463. else
  464. returnTotal = newTotal
  465. end
  466.  
  467. return returnTotal
  468. end
  469.  
  470. function getTargFromCurrent()
  471. local Current = Current.Part
  472. if Current:IsA("BasePart") then
  473. return Current
  474. elseif Current:findFirstChild("Torso") then
  475. return Current.Torso
  476. else
  477. for _,v in pairs(Current:GetChildren()) do
  478. if v:IsA("BasePart") then
  479. return v
  480. end
  481. end
  482. end
  483. end
  484.  
  485. function Fire(Part, Vec, Inv)
  486. pcall(function()
  487. Current.BP:Destroy()
  488. Current.BP = nil
  489. end)
  490. pcall(function()
  491. Current.BA:Destroy()
  492. Current.BA = nil
  493. end)
  494. pcall(function()
  495. if Inv then
  496. Part.Velocity = -((Vec - Torso.Position).unit * Grav * 1.1)
  497. else
  498. Part.Velocity = ((Vec - Camera.CoordinateFrame.p).unit * Grav * 1.1)
  499. end
  500. Current.Mass = nil
  501. end)
  502. Reset()
  503. end
  504.  
  505. function Reset()
  506. LS.Parent = nil
  507. RS.Parent = nil
  508.  
  509. OrigLS.Parent = Torso
  510. OrigRS.Parent = Torso
  511.  
  512. OrigLS.C0 = LS0
  513. OrigRS.C0 = RS0
  514. end
  515.  
  516. function Start()
  517. Cor(function()
  518. repeat wait(1/30) until LP.Character and LP.Character.Parent == Workspace and LP.Character:findFirstChild("Torso")
  519. Char = LP.Character
  520. PlrGui = LP.PlayerGui
  521. Backpack = LP.Backpack
  522. Mouse = LP:GetMouse()
  523.  
  524. for _,v in pairs(Cons) do
  525. v:disconnect()
  526. end
  527. Cons = {}
  528.  
  529. Camera = Workspace.CurrentCamera
  530. LastCamCF = Camera.CoordinateFrame
  531. AnimJoints = {}
  532. mDown = false
  533. Multi = false
  534. Grabbing = false
  535. Current = {}
  536. Alpha = 1
  537.  
  538. Head = Char["Head"]
  539. Torso = Char["Torso"]
  540. Humanoid = Char["Humanoid"]
  541. LA = Char["Left Arm"]
  542. RA = Char["Right Arm"]
  543. LL = Char["Left Leg"]
  544. RL = Char["Right Leg"]
  545.  
  546. OrigLS = Torso["Left Shoulder"]
  547. OrigRS = Torso["Right Shoulder"]
  548.  
  549. for _,v in pairs(Char:GetChildren()) do
  550. if v.Name == ModID then
  551. v:Destroy()
  552. end
  553. end
  554.  
  555. for _,v in pairs(PlrGui:GetChildren()) do
  556. if v.Name == "PadsGui" then
  557. v:Destroy()
  558. end
  559. end
  560.  
  561. LS = Instance.new("Weld")
  562. RS = Instance.new("Weld")
  563.  
  564. LS.Name = OrigLS.Name
  565. LS.Part0 = Torso
  566. LS.Part1 = LA
  567. LS.C0 = LS0
  568. LS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
  569.  
  570. RS.Name = OrigRS.Name
  571. RS.Part0 = Torso
  572. RS.Part1 = RA
  573. RS.C0 = RS0
  574. RS.C1 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
  575.  
  576. local Pads = MakePads()
  577. local LPad = Pads.LBase
  578. local RPad = Pads.RBase
  579.  
  580. weldModel(LPad, true, LPad)
  581. weldModel(RPad, true, RPad)
  582.  
  583. local GripWeldL = Instance.new("Weld")
  584. GripWeldL.Name = "GripWeldL"
  585. GripWeldL.Part0 = LA
  586. GripWeldL.Part1 = LPad
  587. GripWeldL.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
  588. GripWeldL.Parent = LA
  589.  
  590. local GripWeldR = Instance.new("Weld")
  591. GripWeldR.Name = "GripWeldR"
  592. GripWeldR.Part0 = RA
  593. GripWeldR.Part1 = RPad
  594. GripWeldR.C0 = CFrame.new(0, -1.05, 0) * CFrame.Angles(0, math.rad(180), 0)
  595. GripWeldR.Parent = RA
  596.  
  597. local isParts = false
  598.  
  599. table.insert(Cons, Mouse.KeyDown:connect(function(Key)
  600. Key = Key:lower()
  601. if Key == "z" then
  602. --Stuff
  603. elseif Key == "f" then
  604. local Current = Current.Part
  605. if Current and Current.Parent ~= nil and not Multi then
  606. Current:BreakJoints()
  607. end
  608. elseif Key == "q" then
  609. if isParts then
  610. isParts = false
  611. for _,v in pairs(Workspace:GetChildren()) do
  612. if v.Name == "MyPartV" and v:IsA("BasePart") then
  613. v:Destroy()
  614. end
  615. end
  616. else
  617. isParts = true
  618. for i = 1, 50 do
  619. local Part = Instance.new("Part")
  620. Part.Color = Color3.new(math.random(), math.random(), math.random())
  621. Part.Transparency = 0
  622. Part.Size = Vector3.new(math.random(1, 3), math.random(1, 3), math.random(1, 3))
  623. Part.Archivable = true
  624. Part.CanCollide = false
  625. Part.Material = "Neon"
  626. Part.Locked = false
  627. Part.CFrame = Torso.CFrame * CFrame.new(math.random(-15, 15), -1, math.random(-15, 15))
  628. Part.Anchored = true
  629. Part.Name = "MyPartV"
  630. Part.TopSurface = "Smooth"
  631. Part.BottomSurface = "Smooth"
  632. Part.Parent = Workspace
  633. end
  634. end
  635. elseif Key == "e" then
  636. local Targ;
  637. if Current.Part and Current.Part ~= nil then
  638. Targ = getTargFromCurrent()
  639. else
  640. Targ = LastPart
  641. end
  642. if Targ and Targ.Parent ~= nil and not Multi then
  643. local Ex = Instance.new("Explosion", Workspace)
  644. Ex.Position = Targ.CFrame.p
  645. Ex.BlastRadius = 16
  646. Ex.DestroyJointRadiusPercent = 0.5
  647. end
  648. elseif Key == "c" then
  649. if Current.Part and Current.Part.Parent ~= nil and not Multi then
  650. local Part = getTargFromCurrent()
  651. if Part then
  652. Grabbing = false
  653. if Mouse.Hit then
  654. local TargPos = CFrame.new(Camera.CoordinateFrame.p, Mouse.Hit.p) * CFrame.new(0, 0, -1000)
  655. Fire(Part, TargPos.p)
  656. else
  657. Fire(Part, Mouse.Origin.p + Mouse.UnitRay.Direction, true)
  658. end
  659. end
  660. end
  661. end
  662. end))
  663.  
  664. table.insert(Cons, Mouse.Button1Up:connect(function()
  665. mDown = false
  666. if Grabbing == true and Multi == false then
  667. Grabbing = false
  668. Reset()
  669. end
  670. if Current.Part ~= nil then
  671. LastPart = getTargFromCurrent()
  672. Current = {}
  673. end
  674. end))
  675.  
  676. local function makeLightning(Par, Start, End, Width, Length, RandomScale, ArcScale, Num1)
  677. local oldParts = {}
  678. for _,v in pairs(Par:GetChildren()) do
  679. v.CFrame = CFrame.new(5e5, 5e5, 5e5)
  680. table.insert(oldParts, v)
  681. end
  682. local Distance = (Start-End).Magnitude
  683. local ArcScale = ArcScale or 1
  684. local RandomScale = RandomScale or 0
  685. local Last = Start
  686. local IterNum = 0
  687.  
  688. while Par.Parent do
  689. IterNum = IterNum + 1
  690. local New = nil
  691. if (Last-End).Magnitude < Length then
  692. New = CFrame.new(End)
  693. else
  694. if (End-Last).Magnitude < Length*2 then
  695. RandomScale = RandomScale*0.5
  696. ArcScale = ArcScale*0.5
  697. end
  698. local Direct = CFrame.new(Last,End)
  699. New = Direct*CFrame.Angles(math.rad(math.random(-RandomScale/4,RandomScale*ArcScale)),math.rad(math.random(-RandomScale,RandomScale)),math.rad(math.random(-RandomScale,RandomScale)))
  700. New = New*CFrame.new(0,0,-Length)
  701. end
  702. local Trail = nil
  703. if oldParts[IterNum] then
  704. Trail = oldParts[IterNum]
  705. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Thootpaste")) or BrickColor.new("Pastel green")
  706. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  707. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  708. oldParts[IterNum] = nil
  709. else
  710. Trail = Instance.new("Part")
  711. Trail.Name = "Part"
  712. Trail.FormFactor = "Custom"
  713. Trail.BrickColor = ((Num1 % 2 == 0) and BrickColor.new("Lime green")) or BrickColor.new("Lime green")
  714. Trail.Transparency = 0
  715. Trail.Anchored = true
  716. Trail.CanCollide = false
  717. Trail.Locked = true
  718. Trail.BackSurface = "SmoothNoOutlines"
  719. Trail.BottomSurface = "SmoothNoOutlines"
  720. Trail.FrontSurface = "SmoothNoOutlines"
  721. Trail.LeftSurface = "SmoothNoOutlines"
  722. Trail.RightSurface = "SmoothNoOutlines"
  723. Trail.TopSurface = "SmoothNoOutlines"
  724. Trail.Material = "Neon"
  725. Trail.Size = Vector3.new(Width, (Last-New.p).Magnitude, Width)
  726. Trail.CFrame = CFrame.new(New.p, Last)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0, -(Last-New.p).Magnitude/2, 0)
  727. Trail.Parent = Par
  728. end
  729. Last = New.p
  730. if (Last-End).Magnitude < 1 then
  731. break
  732. end
  733. end
  734. for _,v in pairs(oldParts) do
  735. v:Destroy()
  736. end
  737. end
  738.  
  739. table.insert(Cons, Mouse.Button1Down:connect(function()
  740. mDown = true
  741. local Targ = Mouse.Target
  742. Cor(function()
  743. if Targ and Objects[Targ] and not Multi then
  744. Grabbing = true
  745. Current.Part = Targ
  746. local Mass = Objects[Targ]
  747. local ForceNum = 0
  748. local Hum = nil
  749.  
  750. for _,v in pairs(Targ:GetChildren()) do
  751. if BodyObjects[v.ClassName] then
  752. v:Destroy()
  753. end
  754. end
  755.  
  756. for _,v in pairs(Workspace:GetChildren()) do
  757. if v:findFirstChild("Humanoid") and v:IsAncestorOf(Targ) then
  758. Hum = v.Humanoid
  759. Mass = getMass(v, 0)
  760. Current.Part = v
  761. break
  762. end
  763. end
  764.  
  765. Current.Mass = Mass
  766.  
  767. if not Hum then
  768. Targ:BreakJoints()
  769. end
  770.  
  771. ForceNum = Mass * Grav
  772. Targ.CanCollide = true
  773. Targ.Anchored = false
  774.  
  775. local BP = Instance.new("BodyPosition")
  776. BP.maxForce = Vector3.new(3 * ForceNum, 3 * ForceNum, 3 * ForceNum)
  777. BP.Parent = Targ
  778.  
  779. local Ang = Instance.new("BodyAngularVelocity")
  780. Ang.Parent = Targ
  781.  
  782. Current.BP = BP
  783. Current.BA = Ang
  784.  
  785. OrigLS.Parent = nil
  786. OrigRS.Parent = nil
  787.  
  788. LS.Parent = Torso
  789. RS.Parent = Torso
  790.  
  791. LS.C0 = LS0
  792. RS.C0 = RS0
  793.  
  794. local DirDot = Mouse.UnitRay.Direction:Dot(Targ.Position - Mouse.Origin.p)
  795. local BPPos = Vector3.new(0, 0, 0)
  796. local Vel = Vector3.new(0, 0, 0)
  797. local Vlev = random() * math.pi
  798. local RPos = Vector3.new(random() * 2 - 1, cos(Vlev), random() * 2 - 1)
  799.  
  800. local Ball = Instance.new("Part")
  801. Ball.Name = "Ball"
  802. Ball.FormFactor = "Custom"
  803. Ball.Color = Color3.new(248, 248, 248)
  804. Ball.Transparency = 0.3
  805. Ball.Anchored = true
  806. Ball.CanCollide = false
  807. Ball.Locked = true
  808. Ball.BottomSurface, Ball.TopSurface = "Smooth", "Smooth"
  809. Ball.Size = Vector3.new(4, 4, 4)
  810. Ball.CFrame = Torso.CFrame * CFrame.new(0, 1, -3)
  811. Ball.Parent = Char
  812.  
  813. if Targ.Name == "MyPartV" then
  814. Targ.Name = "MyPartF"
  815. end
  816.  
  817. local LightMod = Instance.new("Model", Char)
  818.  
  819. local Mesh = Instance.new("SpecialMesh")
  820. Mesh.MeshType = "Sphere"
  821. Mesh.Parent = Ball
  822.  
  823. local Size = 0.5
  824. local Rise = true
  825.  
  826. while Grabbing and BP and Ang and Targ.Parent ~= nil do
  827. local BPPos = Mouse.Origin.p + Mouse.UnitRay.Direction * DirDot
  828. Ang.angularvelocity = Vel
  829. BP.position = BPPos + RPos
  830. 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)))
  831. 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)))
  832. Vlev = (Vlev + 0.05) % tau
  833.  
  834. if Hum then
  835. Hum.Sit = true
  836. end
  837.  
  838. if LA.Parent ~= nil and RA.Parent ~= nil then
  839. local LPos = (LA.CFrame * CFrame.new(0, -1, 0)).p
  840. local RPos = (RA.CFrame * CFrame.new(0, -1, 0)).p
  841. if Rise == true then
  842. if Size < 0.6 then
  843. Size = Size + 0.05
  844. else
  845. Size = Size + 0.1
  846. end
  847. if Size >= 2.2 then
  848. Rise = false
  849. end
  850. else
  851. if Size > 2.1 then
  852. Size = Size - 0.05
  853. else
  854. Size = Size - 0.1
  855. end
  856. if Size <= 0.5 then
  857. Rise = true
  858. end
  859. end
  860. Ball.Size = Vector3.new(Size, Size, Size)
  861. Ball.CFrame = CFrame.new(LPos:Lerp(RPos, 0.5), Targ.Position) * CFrame.new(0, 0, -2.2)
  862. LightNum = LightNum + 1
  863. makeLightning(LightMod, Ball.Position, Targ.Position, 0.2, 4, 50, 1, LightNum)
  864. elseif Ball.Parent ~= nil then
  865. Ball:Destroy()
  866. end
  867.  
  868. if LS and LS.Parent == Torso then
  869. 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))
  870. end
  871. if RS and RS.Parent == Torso then
  872. 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))
  873. end
  874. RunService.Heartbeat:wait()
  875. end
  876.  
  877. coroutine.resume(coroutine.create(function()
  878. for i = 0.5, 1, 0.1 do
  879. for i2,v in pairs(LightMod:GetChildren()) do
  880. --v.Light.Range = 6-(i*5)
  881. v.Transparency = i
  882. end
  883. wait(1/30)
  884. end
  885. LightMod:Destroy()
  886. end))
  887.  
  888. if BP and BP.Parent ~= nil then
  889. BP:Destroy()
  890. end
  891.  
  892. if Ang and Ang.Parent ~= nil then
  893. Ang:Destroy()
  894. end
  895.  
  896. pcall(function() Ball:Destroy() end)
  897. end
  898. end)
  899. end))
  900. end)
  901. end
  902.  
  903. function Add(Obj)
  904. if Obj:IsA("BasePart") and not Objects[Obj] and not (Obj.Name == "Base" and Obj.ClassName == "Part") then
  905. Objects[Obj] = Obj:GetMass()
  906. Obj.Changed:connect(function(P)
  907. if P:lower() == "size" and Objects[Obj] and Obj.Parent ~= nil then
  908. Objects[Obj] = Obj:GetMass()
  909. end
  910. end)
  911. end
  912. end
  913.  
  914. function Rem(Obj)
  915. if Objects[Obj] then
  916. Objects[Obj] = nil
  917. end
  918. end
  919.  
  920. function Recursion(Obj)
  921. ypcall(function()
  922. Add(Obj)
  923. if #Obj:GetChildren() > 0 then
  924. for _,v in pairs(Obj:GetChildren()) do
  925. Recursion(v)
  926. end
  927. end
  928. end)
  929. end
  930.  
  931. Workspace.DescendantAdded:connect(function(Obj)
  932. Add(Obj)
  933. end)
  934.  
  935. Workspace.DescendantRemoving:connect(function(Obj)
  936. Rem(Obj)
  937. end)
  938.  
  939. for _,v in pairs(Workspace:GetChildren()) do
  940. Recursion(v)
  941. end
  942.  
  943. Start()
  944.  
  945. if LP.Name == PlrName then
  946. LP.CharacterAdded:connect(Start)
  947. end
  948.  
  949. local verlet = {}
  950. verlet.step_time = 1 / 50
  951. verlet.gravity = Vector3.new(0, -10, 0)
  952.  
  953. local char = game.Players.LocalPlayer.Character
  954. local torso = char:WaitForChild("Torso")
  955. local parts = {}
  956. local render = game:GetService("RunService").RenderStepped
  957.  
  958. wait(2)
  959.  
  960. local point = {}
  961. local link = {}
  962. local rope = {}
  963.  
  964. local function ccw(A,B,C)
  965. return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
  966. end
  967.  
  968. local function intersect(A,B,C,D)
  969. return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
  970. end
  971.  
  972. local function vec2(v)
  973. return Vector2.new(v.x, v.z)
  974. end
  975.  
  976. function point:step()
  977. if not self.fixed then
  978. local derivative = (self.position - self.last_position) * 0.95
  979. self.last_position = self.position
  980. self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
  981. --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
  982. local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
  983. local pointE = self.position + torso.CFrame.lookVector * 100
  984. local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
  985. if not doIntersect then
  986. self.postition = self.position - torso.CFrame.lookVector * 10
  987. end]]
  988. end
  989. end
  990.  
  991. function link:step()
  992. for i = 1, 1 do
  993. local distance = self.point1.position - self.point2.position
  994. local magnitude = distance.magnitude
  995. local differance = (self.length - magnitude) / magnitude
  996. local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
  997. if not self.point1.fixed then
  998. self.point1.position = self.point1.position + translation
  999. end
  1000. if not self.point2.fixed then
  1001. self.point2.position = self.point2.position - translation
  1002. end
  1003. end
  1004. end
  1005.  
  1006. function verlet.new(class, a, b, c)
  1007. if class == "Point" then
  1008. local new = {}
  1009. setmetatable(new, {__index = point})
  1010. new.class = class
  1011. new.position = a or Vector3.new()
  1012. new.last_position = new.position
  1013. new.velocity = verlet.gravity
  1014. new.fixed = false
  1015. return new
  1016. elseif class == "Link" then
  1017. local new = {}
  1018. setmetatable(new, {__index = link})
  1019. new.class = class
  1020. new.point1 = a
  1021. new.point2 = b
  1022. new.length = c or (a.position - b.position).magnitude
  1023. return new
  1024. elseif class == "Rope" then
  1025. local new = {}
  1026. setmetatable(new, {__index = link})
  1027. new.class = class
  1028. new.start_point = a
  1029. new.finish_point = b
  1030. new.points = {}
  1031. new.links = {}
  1032. local inc = (b - a) / 10
  1033. for i = 0, 10 do
  1034. table.insert(new.points, verlet.new("Point", a + (i * inc)))
  1035. end
  1036. for i = 2, #new.points do
  1037. table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
  1038. end
  1039. return new
  1040. end
  1041. end
  1042.  
  1043. local tris = {}
  1044. local triParts = {}
  1045.  
  1046. local function GetDiscoColor(hue)
  1047. local section = hue % 1 * 3
  1048. local secondary = 0.5 * math.pi * (section % 1)
  1049. if section < 1 then
  1050. return Color3.new(0, 0, 0)
  1051. elseif section < 2 then
  1052. return Color3.new(0, 0, 0)
  1053. else
  1054. return Color3.new(0, 0, 0)
  1055. end
  1056. end
  1057.  
  1058. local function setupPart(part)
  1059. part.Anchored = true
  1060. part.FormFactor = 3
  1061. part.CanCollide = false
  1062. part.TopSurface = 10
  1063. part.BottomSurface = 10
  1064. part.LeftSurface = 10
  1065. part.RightSurface = 10
  1066. part.FrontSurface = 10
  1067. part.BackSurface = 10
  1068. part.Material = "Neon"
  1069. local m = Instance.new("SpecialMesh", part)
  1070. m.MeshType = "Wedge"
  1071. m.Scale = Vector3.new(0.2, 1, 1)
  1072. return part
  1073. end
  1074.  
  1075. local function CFrameFromTopBack(at, top, back)
  1076. local right = top:Cross(back)
  1077. return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  1078. end
  1079.  
  1080. local function drawTri(parent, a, b, c)
  1081. local this = {}
  1082. local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  1083. local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  1084. function this:Set(a, b, c)
  1085. local ab, bc, ca = b-a, c-b, a-c
  1086. local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
  1087. local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
  1088. local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
  1089. local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
  1090. if edg1 < edg2 then
  1091. if edg1 >= edg3 then
  1092. a, b, c = c, a, b
  1093. ab, bc, ca = ca, ab, bc
  1094. abm = cam
  1095. end
  1096. else
  1097. if edg2 < edg3 then
  1098. a, b, c = b, c, a
  1099. ab, bc, ca = bc, ca, ab
  1100. abm = bcm
  1101. else
  1102. a, b, c = c, a, b
  1103. ab, bc, ca = ca, ab, bc
  1104. abm = cam
  1105. end
  1106. end
  1107.  
  1108. local len1 = -ca:Dot(ab)/abm
  1109. local len2 = abm - len1
  1110. local width = (ca + ab.unit*len1).magnitude
  1111.  
  1112. local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
  1113.  
  1114. if len1 > 0.2 then
  1115. mPart1.Parent = parent
  1116. mPart1.Size = Vector3.new(0.2, width, len1)
  1117. mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  1118. else
  1119. mPart1.Parent = nil
  1120. end
  1121.  
  1122. if len2 > 0.2 then
  1123. mPart2.Parent = parent
  1124. mPart2.Size = Vector3.new(0.2, width, len2)
  1125. mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  1126. else
  1127. mPart2.Parent = nil
  1128. end
  1129. end
  1130. function this:SetProperty(prop, value)
  1131. mPart1[prop] = value
  1132. mPart2[prop] = value
  1133. end
  1134. this:Set(a, b, c)
  1135. function this:Destroy()
  1136. mPart1:Destroy()
  1137. mPart2:Destroy()
  1138. end
  1139. this.p1 = mPart1
  1140. this.p2 = mPart2
  1141. this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
  1142. this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
  1143. return this
  1144. end
  1145.  
  1146. function verlet.draw(object, id)
  1147. if object.class == "Point" then
  1148. local part = parts[id]
  1149. part.BrickColor = BrickColor.new(255, 0, 0)
  1150. part.Transparency = 0
  1151. part.formFactor = 3
  1152. part.Anchored = true
  1153. part.CanCollide = false
  1154. part.TopSurface = 0
  1155. part.BottomSurface = 0
  1156. part.Size = Vector3.new(0.35, 0.35, 0.35)
  1157. part.Material = "Neon"
  1158. part.CFrame = CFrame.new(object.position)
  1159. part.Parent = torso
  1160. return part
  1161. elseif object.class == "Link" then
  1162. local part = parts[id]
  1163. local dist = (object.point1.position - object.point2.position).magnitude
  1164. part.Size = Vector3.new(0.2, 0.2, dist)
  1165. part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
  1166. part.Parent = torso
  1167. return part
  1168. end
  1169. end
  1170.  
  1171. function verlet.clear()
  1172. for _, v in pairs(workspace:GetChildren()) do
  1173. if v.Name == "Part" then
  1174. v:Destroy()
  1175. end
  1176. end
  1177. end
  1178.  
  1179. local points = {}
  1180. local links = {}
  1181.  
  1182. for x = 0, 2 do
  1183. points[x] = {}
  1184. for y = 0, 3 do
  1185. points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
  1186. points[x][y].fixed = y == 0
  1187. end
  1188. end
  1189.  
  1190. for x = 1, 2 do
  1191. for y = 0, 3 do
  1192. links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
  1193. end
  1194. end
  1195.  
  1196. for x = 0, 2 do
  1197. for y = 1, 3 do
  1198. links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
  1199. end
  1200. end
  1201.  
  1202. render:connect(function()
  1203. for x = 0, 2 do
  1204. for y = 0, 3 do
  1205. if y == 0 then
  1206. points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
  1207. else
  1208. points[x][y]:step()
  1209. end
  1210. end
  1211. end
  1212. for i = 1, #links do
  1213. links[i]:step()
  1214. end
  1215. for i = 1, #tris do
  1216. triParts[#triParts + 1] = tris[i].p1
  1217. triParts[#triParts + 1] = tris[i].p2
  1218. end
  1219. tris = {}
  1220. for x = 1, 2 do
  1221. for y = 1, 3 do
  1222. tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
  1223. tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
  1224. end
  1225. end
  1226. end)
  1227. local verlet = {}
  1228. verlet.step_time = 1 / 50
  1229. verlet.gravity = Vector3.new(0, -10, 0)
  1230.  
  1231. local char = game.Players.LocalPlayer.Character
  1232. local torso = char:WaitForChild("Torso")
  1233. local parts = {}
  1234. local render = game:GetService("RunService").RenderStepped
  1235.  
  1236. wait(2)
  1237.  
  1238. local point = {}
  1239. local link = {}
  1240. local rope = {}
  1241.  
  1242. local function ccw(A,B,C)
  1243. return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
  1244. end
  1245.  
  1246. local function intersect(A,B,C,D)
  1247. return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
  1248. end
  1249.  
  1250. local function vec2(v)
  1251. return Vector2.new(v.x, v.z)
  1252. end
  1253.  
  1254. function point:step()
  1255. if not self.fixed then
  1256. local derivative = (self.position - self.last_position) * 0.95
  1257. self.last_position = self.position
  1258. self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
  1259. --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
  1260. local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
  1261. local pointE = self.position + torso.CFrame.lookVector * 100
  1262. local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
  1263. if not doIntersect then
  1264. self.postition = self.position - torso.CFrame.lookVector * 10
  1265. end]]
  1266. end
  1267. end
  1268.  
  1269. function link:step()
  1270. for i = 1, 1 do
  1271. local distance = self.point1.position - self.point2.position
  1272. local magnitude = distance.magnitude
  1273. local differance = (self.length - magnitude) / magnitude
  1274. local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
  1275. if not self.point1.fixed then
  1276. self.point1.position = self.point1.position + translation
  1277. end
  1278. if not self.point2.fixed then
  1279. self.point2.position = self.point2.position - translation
  1280. end
  1281. end
  1282. end
  1283.  
  1284. function verlet.new(class, a, b, c)
  1285. if class == "Point" then
  1286. local new = {}
  1287. setmetatable(new, {__index = point})
  1288. new.class = class
  1289. new.position = a or Vector3.new()
  1290. new.last_position = new.position
  1291. new.velocity = verlet.gravity
  1292. new.fixed = false
  1293. return new
  1294. elseif class == "Link" then
  1295. local new = {}
  1296. setmetatable(new, {__index = link})
  1297. new.class = class
  1298. new.point1 = a
  1299. new.point2 = b
  1300. new.length = c or (a.position - b.position).magnitude
  1301. return new
  1302. elseif class == "Rope" then
  1303. local new = {}
  1304. setmetatable(new, {__index = link})
  1305. new.class = class
  1306. new.start_point = a
  1307. new.finish_point = b
  1308. new.points = {}
  1309. new.links = {}
  1310. local inc = (b - a) / 10
  1311. for i = 0, 10 do
  1312. table.insert(new.points, verlet.new("Point", a + (i * inc)))
  1313. end
  1314. for i = 2, #new.points do
  1315. table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
  1316. end
  1317. return new
  1318. end
  1319. end
  1320.  
  1321. local tris = {}
  1322. local triParts = {}
  1323.  
  1324. local function GetDiscoColor(hue)
  1325. local section = hue % 1 * 3
  1326. local secondary = 0.5 * math.pi * (section % 1)
  1327. if section < 1 then
  1328. return Color3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
  1329. elseif section < 2 then
  1330. return Color3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
  1331. else
  1332. return Color3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
  1333. end
  1334. end
  1335.  
  1336. local function setupPart(part)
  1337. part.Anchored = true
  1338. part.FormFactor = 3
  1339. part.CanCollide = false
  1340. part.TopSurface = 10
  1341. part.BottomSurface = 10
  1342. part.LeftSurface = 10
  1343. part.RightSurface = 10
  1344. part.FrontSurface = 10
  1345. part.BackSurface = 10
  1346. part.Material = "Neon"
  1347. local m = Instance.new("SpecialMesh", part)
  1348. m.MeshType = "Wedge"
  1349. m.Scale = Vector3.new(0.2, 1, 1)
  1350. return part
  1351. end
  1352.  
  1353. local function CFrameFromTopBack(at, top, back)
  1354. local right = top:Cross(back)
  1355. return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  1356. end
  1357.  
  1358. local function drawTri(parent, a, b, c)
  1359. local this = {}
  1360. local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  1361. local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  1362. function this:Set(a, b, c)
  1363. local ab, bc, ca = b-a, c-b, a-c
  1364. local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
  1365. local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
  1366. local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
  1367. local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
  1368. if edg1 < edg2 then
  1369. if edg1 >= edg3 then
  1370. a, b, c = c, a, b
  1371. ab, bc, ca = ca, ab, bc
  1372. abm = cam
  1373. end
  1374. else
  1375. if edg2 < edg3 then
  1376. a, b, c = b, c, a
  1377. ab, bc, ca = bc, ca, ab
  1378. abm = bcm
  1379. else
  1380. a, b, c = c, a, b
  1381. ab, bc, ca = ca, ab, bc
  1382. abm = cam
  1383. end
  1384. end
  1385.  
  1386. local len1 = -ca:Dot(ab)/abm
  1387. local len2 = abm - len1
  1388. local width = (ca + ab.unit*len1).magnitude
  1389.  
  1390. local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
  1391.  
  1392. if len1 > 0.2 then
  1393. mPart1.Parent = parent
  1394. mPart1.Size = Vector3.new(0.2, width, len1)
  1395. mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  1396. else
  1397. mPart1.Parent = nil
  1398. end
  1399.  
  1400. if len2 > 0.2 then
  1401. mPart2.Parent = parent
  1402. mPart2.Size = Vector3.new(0.2, width, len2)
  1403. mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  1404. else
  1405. mPart2.Parent = nil
  1406. end
  1407. end
  1408. function this:SetProperty(prop, value)
  1409. mPart1[prop] = value
  1410. mPart2[prop] = value
  1411. end
  1412. this:Set(a, b, c)
  1413. function this:Destroy()
  1414. mPart1:Destroy()
  1415. mPart2:Destroy()
  1416. end
  1417. this.p1 = mPart1
  1418. this.p2 = mPart2
  1419. this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
  1420. this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
  1421. return this
  1422. end
  1423.  
  1424. function verlet.draw(object, id)
  1425. if object.class == "Point" then
  1426. local part = parts[id]
  1427. part.BrickColor = BrickColor.new(1, 1, 1)
  1428. part.Transparency = 0
  1429. part.formFactor = 3
  1430. part.Anchored = true
  1431. part.CanCollide = false
  1432. part.TopSurface = 0
  1433. part.BottomSurface = 0
  1434. part.Size = Vector3.new(0.35, 0.35, 0.35)
  1435. part.Material = "Neon"
  1436. part.CFrame = CFrame.new(object.position)
  1437. part.Parent = torso
  1438. return part
  1439. elseif object.class == "Link" then
  1440. local part = parts[id]
  1441. local dist = (object.point1.position - object.point2.position).magnitude
  1442. part.Size = Vector3.new(0.2, 0.2, dist)
  1443. part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
  1444. part.Parent = torso
  1445. return part
  1446. end
  1447. end
  1448.  
  1449. function verlet.clear()
  1450. for _, v in pairs(workspace:GetChildren()) do
  1451. if v.Name == "Part" then
  1452. v:Destroy()
  1453. end
  1454. end
  1455. end
  1456.  
  1457. local points = {}
  1458. local links = {}
  1459.  
  1460. for x = 0, 2 do
  1461. points[x] = {}
  1462. for y = 0, 3 do
  1463. points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
  1464. points[x][y].fixed = y == 0
  1465. end
  1466. end
  1467.  
  1468. for x = 1, 2 do
  1469. for y = 0, 3 do
  1470. links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
  1471. end
  1472. end
  1473.  
  1474. for x = 0, 2 do
  1475. for y = 1, 3 do
  1476. links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
  1477. end
  1478. end
  1479.  
  1480. render:connect(function()
  1481. for x = 0, 2 do
  1482. for y = 0, 3 do
  1483. if y == 0 then
  1484. points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
  1485. else
  1486. points[x][y]:step()
  1487. end
  1488. end
  1489. end
  1490. for i = 1, #links do
  1491. links[i]:step()
  1492. end
  1493. for i = 1, #tris do
  1494. triParts[#triParts + 1] = tris[i].p1
  1495. triParts[#triParts + 1] = tris[i].p2
  1496. end
  1497. tris = {}
  1498. for x = 1, 2 do
  1499. for y = 1, 3 do
  1500. tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
  1501. tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
  1502. end
  1503. end
  1504. end)
  1505. --[[
  1506. ...
  1507. ]]
  1508.  
  1509. local part = game.Players.LocalPlayer.Character
  1510. local basetemplate = "http://www.roblox.com/asset/?id="
  1511. local shirt = 47740174
  1512. local pants = 47740174
  1513. local h = part:findFirstChild("Shirt")
  1514. if h ~= nil then
  1515. h.ShirtTemplate = basetemplate..shirt
  1516. else
  1517. local i = Instance.new("Shirt")
  1518. i.Name = "Shirt"
  1519. i.ShirtTemplate = basetemplate..shirt
  1520. i.Parent = part
  1521. end
  1522. local p = part:findFirstChild("Pants")
  1523. if p ~= nil then
  1524. p.PantsTemplate = basetemplate..pants
  1525. else
  1526. local np = Instance.new("Pants")
  1527. np.PantsTemplate = basetemplate..pants
  1528. np.Name = "Pants"
  1529. np.Parent = part
  1530. end
  1531. ------TAUNT
  1532. local plr = game.Players.LocalPlayer
  1533. local chr = plr.Character
  1534. local mouse = plr:GetMouse()
  1535.  
  1536. _G.hotkey = 't'
  1537.  
  1538. mouse.KeyDown:connect(function(key)
  1539. if key == _G.hotkey then
  1540. local chr = game.Players.LocalPlayer.Character
  1541. stopAnimations()
  1542. chr.Animate.Disabled = true
  1543. chr.Torso["Left Shoulder"].C1 = CFrame.new(0, 0.699999988, 0, 0.939692616, 0, -0.342020124, -0.330366075, -0.258819044, -0.907673359, -0.0885213241, 0.965925813, -0.243210346)
  1544. chr.Torso["Right Shoulder"].C1 = CFrame.new(-0.600000024, 0.5, -0.200000003, 0.664462984, 0.241844743, 0.707106769, -0.664462984, -0.241844788, 0.707106769, 0.342020154, -0.939692616, -3.09086197e-008)
  1545. chr.Torso["Neck"].C1 = CFrame.new(0, -0.600000024, 0, -0.866025388, 0.5, 0, -0.171010137, -0.29619807, 0.939692616, 0.469846278, 0.813797653, 0.342020124)
  1546. end
  1547. end)
  1548.  
  1549. mouse.KeyUp:connect(function(key)
  1550. if key == _G.hotkey then
  1551. local chr = game.Players.LocalPlayer.Character
  1552. chr.Animate.Disabled = false
  1553. chr.Torso["Left Shoulder"].C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1554. chr.Torso["Right Shoulder"].C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1555. chr.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  1556. end
  1557. end)
  1558.  
  1559. function stopAnimations()
  1560. for _,v in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
  1561. v:Stop()
  1562. end
  1563. end
  1564. --eraser
  1565. lplr = game.Players.LocalPlayer
  1566. lchar = lplr.Character
  1567. lhum = lchar:FindFirstChild("Humanoid")
  1568. lrootpart = lhum:FindFirstChild("HumanoidRootPart")
  1569. torso = lchar:FindFirstChild("Torso")
  1570. animator = lhum.Animator
  1571. backpack = lplr.Backpack
  1572. ls = torso:FindFirstChild("Left Shoulder")
  1573. ra = lchar:FindFirstChild("Right Arm")
  1574. lh = torso:FindFirstChild("Left Hip")
  1575. la = lchar:FindFirstChild("Left Arm")
  1576. rs = torso:FindFirstChild("Right Shoulder")
  1577. rh = torso:FindFirstChild("Right Hip")
  1578. rl = lchar:FindFirstChild("Right Leg")
  1579. ll = lchar:FindFirstChild("Left Leg")
  1580. neck = torso:FindFirstChild("Neck")
  1581. v3 = Vector3.new
  1582. cf = CFrame
  1583. create = Instance.new
  1584. pgui = lplr.PlayerGui --game.CoreGui
  1585. --[[To do:
  1586. 1. Make a working FE kill gui
  1587. a) Position to bottom right [./]
  1588. b) Finish it :)
  1589. 2. Add tp into it (tp to other player)
  1590.  
  1591. --]]
  1592. local gui = Instance.new("ScreenGui")
  1593. gui.Parent = pgui
  1594. local generalframe = Instance.new("Frame")
  1595. generalframe.Size = UDim2.new(0, 350, 0, 140)
  1596. generalframe.Position = UDim2.new(0.75, 0, 0.75, 0)
  1597. generalframe.BackgroundColor3 = BrickColor.new("Fossil").Color
  1598. generalframe.BorderSizePixel = 5
  1599. generalframe.BorderColor3 = BrickColor.new("Dark stone grey").Color
  1600. generalframe.Transparency = 0.25
  1601. generalframe.Active = true
  1602. generalframe.Draggable = true
  1603. generalframe.Parent = gui
  1604. local plrBox = Instance.new("TextBox")
  1605. plrBox.Parent = generalframe
  1606. plrBox.Size = UDim2.new(0, 300, 0, 42.5)
  1607. plrBox.Position = UDim2.new(0.075, 0, 0.2, 0)
  1608. plrBox.BackgroundColor3 = BrickColor.new("Fossil").Color
  1609. plrBox.BorderSizePixel = 5
  1610. plrBox.BorderColor3 = BrickColor.new("Dark stone grey").Color
  1611. plrBox.FontSize = Enum.FontSize.Size28
  1612. plrBox.Font = "SciFi"
  1613. plrBox.TextColor3 = Color3.new(17, 17, 17)
  1614. plrBox.Transparency = 0.175
  1615. plrBox.Text = "Who u want to erase?"
  1616. local execbutton = Instance.new("TextButton")
  1617. execbutton.Size = UDim2.new(0, 300, 0, 27.5)
  1618. execbutton.Position = plrBox.Position + UDim2.new(0, 0, 0, 54)
  1619. execbutton.BackgroundColor3 = BrickColor.new("Fossil").Color
  1620. execbutton.BorderSizePixel = 5
  1621. execbutton.BorderColor3 = BrickColor.new("Dark stone grey").Color
  1622. execbutton.Font = "SciFi"
  1623. execbutton.FontSize = Enum.FontSize.Size18
  1624. execbutton.TextColor3 = Color3.new(17, 17, 17)
  1625. execbutton.Transparency = 0.175
  1626. execbutton.Text = "Erase..."
  1627. execbutton.Parent = generalframe
  1628. --[[Function/s being made!]]
  1629.  
  1630. local function getPlayerByString(name)
  1631. for _, Player in pairs(game:service'Players':GetPlayers()) do
  1632. if Player.Name:sub(1, #name):lower() == name:lower() then
  1633. return Player
  1634. end
  1635. end
  1636. end
  1637.  
  1638. function FeKill(Target)
  1639. if plrBox.Text:lower() == "all" or "others" then
  1640. local lpChar = game.Players.LocalPlayer.Character.Torso
  1641.  
  1642.  
  1643. for i,plr in pairs (game.Players:GetChildren()) do
  1644. if plr.Name ~= game.Players.LocalPlayer.Name then
  1645. for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
  1646. if v.ClassName == 'Part' then
  1647. if v.Name ~= 'Head' then
  1648. v.Anchored = true
  1649. end
  1650. end
  1651. end
  1652. local w = Instance.new("Weld", lpChar)
  1653. w.Part0 = lpChar
  1654. w.Part1 = plr.Character.Torso
  1655. w.C0 = lpChar.CFrame
  1656. w.C1 = lpChar.CFrame * CFrame.new(0, -10000, 0)
  1657. wait(0.1)
  1658. w:Destroy()
  1659. for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
  1660. if v.ClassName == 'Part' then
  1661. if v.Name ~= 'Head' then
  1662. v.Anchored = false
  1663. end
  1664. end
  1665. end
  1666. end
  1667. end
  1668. else
  1669. local chosen = getPlayerByString(Target)
  1670. local plr = chosen
  1671. local lpChar = game.Players.LocalPlayer.Character.Torso
  1672.  
  1673. for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
  1674. if v.ClassName == 'Part' then
  1675. if v.Name ~= 'Head' then
  1676. v.Anchored = true
  1677. end
  1678. end
  1679. end
  1680. local w = Instance.new("Weld", lpChar)
  1681. w.Part0 = lpChar
  1682. w.Part1 = plr.Character.Torso
  1683. w.C0 = lpChar.CFrame
  1684. w.C1 = lpChar.CFrame * CFrame.new(0, -10000, 0)
  1685. wait(0.1)
  1686. w:Destroy()
  1687. for i,v in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
  1688. if v.ClassName == 'Part' then
  1689. if v.Name ~= 'Head' then
  1690. v.Anchored = false
  1691. end
  1692. end
  1693. end
  1694. end
  1695.  
  1696. end
  1697.  
  1698. function rekt(Target)
  1699. if plrBox.Text:lower() == "all" then
  1700. for i, v in pairs (game.Players:GetChildren()) do
  1701. local char = v.Character
  1702. if char then
  1703. char:BreakJoints()
  1704. end
  1705. end
  1706. elseif plrBox.Text:lower() == "others" then
  1707. for i, v in pairs (game.Players:GetChildren()) do
  1708. if v.Name ~= lplr.Name then
  1709. local char = v.Character
  1710. if char then
  1711. char:BreakJoints()
  1712. end
  1713. end
  1714. end
  1715. else
  1716. local prehum = getPlayerByString(Target)
  1717. local hum = prehum.Character
  1718. if hum then
  1719. hum:BreakJoints()
  1720. end
  1721. end
  1722.  
  1723.  
  1724. end
  1725. --[[Connecting functions!]]
  1726. execbutton.MouseButton1Down:connect(function()
  1727. if game.Workspace.FilteringEnabled == true then
  1728. FeKill(plrBox.Text)
  1729. elseif game.Workspace.FilteringEnabled ~= true then
  1730. rekt(plrBox.Text)
  1731. end
  1732. end)
Add Comment
Please, Sign In to add comment