thegodgukuroseblack

tele

Jun 25th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.89 KB | None | 0 0
  1. --TWIRL TELEKINESIS (unleaked)
  2. local next=next
  3. local sin=math.sin
  4. local cos=math.cos
  5. local max=math.max
  6. local min=math.min
  7. local tau=2*math.pi
  8. local atan2=math.atan2
  9. local random=math.random
  10. local gp=game:service'Players'
  11. local M=gp.LocalPlayer
  12. script.Parent=nil
  13.  
  14.  
  15. local function test(f)
  16.  
  17. local a,b=coroutine.resume(coroutine.create(f))
  18.  
  19. if not a then
  20.  
  21. local h=Instance.new("Hint",workspace)
  22.  
  23. h.Name="Error"
  24.  
  25. h.Text=b
  26.  
  27. wait(12)
  28.  
  29. h:Destroy()
  30.  
  31. end
  32.  
  33. return a
  34.  
  35. end
  36.  
  37.  
  38. local touchable={"Part","WedgePart","SpawnLocation","TrussPart","VehicleSeat","Seat","FlagStand","Platform","SkateboardPlatform","ParallelRampPart","PrismPart","PyramidPart","RightAngleRampPart","BasePart"}
  39.  
  40. local index={}
  41.  
  42. local function add(p)
  43.  
  44. if test(function() return p.ClassName end) and not index[p] and not (p.Name=="lol" and p.Parent==workspace and p.ClassName=="Part") then
  45.  
  46. for i=1,#touchable do
  47.  
  48. if p.ClassName==touchable[i] then
  49.  
  50. index[p]=p:GetMass()
  51.  
  52. break
  53.  
  54. end
  55.  
  56. end
  57.  
  58. end
  59.  
  60. end
  61.  
  62. local function del(p)
  63.  
  64. if index[p] then
  65.  
  66. index[p]=nil
  67.  
  68. end
  69.  
  70. end
  71.  
  72. local function find(p)
  73.  
  74. add(p)
  75.  
  76. local pgc
  77.  
  78. test(function() pgc=p:getChildren() end)
  79.  
  80. if pgc then
  81.  
  82. for _,c in next,pgc do
  83.  
  84. find(c)
  85.  
  86. end
  87.  
  88. end
  89.  
  90. end
  91.  
  92. workspace.DescendantAdded:connect(add)
  93.  
  94. workspace.DescendantRemoving:connect(del)
  95.  
  96. find(workspace)
  97.  
  98.  
  99. local function getmass(obj)
  100.  
  101. local total=0
  102.  
  103. for i=1,#touchable do
  104.  
  105. if obj.ClassName==touchable[i] then
  106.  
  107. total=index[obj] or obj:GetMass()
  108.  
  109. break
  110.  
  111. end
  112.  
  113. end
  114.  
  115. for _,ch in next,obj:GetChildren() do
  116.  
  117. total=total+getmass(ch)
  118.  
  119. end
  120.  
  121. return total
  122.  
  123. end
  124.  
  125. local maxdis=20
  126.  
  127. local grav=196.2
  128.  
  129. local A,B="http://www.roblox.com/asset?id=88251961","http://www.roblox.com/asset?id=88252842"
  130.  
  131. local tool=Instance.new'HopperBin'
  132.  
  133. tool.Name="Telekenesis"
  134.  
  135. tool.TextureId="http://www.roblox.com/asset?id=88241634"
  136.  
  137. local ev1,ev2,ev3,ev4,ev5
  138.  
  139. local mindex
  140.  
  141. local go=function()
  142.  
  143. if M.Parent then
  144.  
  145. if mindex then
  146.  
  147. for part,i in next,mindex do
  148.  
  149. i.body:Destroy()
  150.  
  151. i.ang:Destroy()
  152.  
  153. end
  154.  
  155. mindex=nil
  156.  
  157. end
  158.  
  159. if ev1 and ev2 and ev3 and ev4 and ev5 then
  160.  
  161. ev1:disconnect()
  162.  
  163. ev2:disconnect()
  164.  
  165. ev3:disconnect()
  166.  
  167. ev4:disconnect()
  168.  
  169. ev5:disconnect()
  170.  
  171. end
  172.  
  173. local newtool=tool:Clone()
  174.  
  175. newtool.Parent=M.Backpack
  176.  
  177. ev1=newtool.Selected:connect(function(m)
  178.  
  179. m.Icon=A
  180.  
  181. local multi=false
  182.  
  183. local grab=false
  184.  
  185. local props
  186.  
  187. local v,d,pos
  188.  
  189. local lpos
  190.  
  191. local body,ang=Instance.new'BodyPosition',Instance.new'BodyAngularVelocity'
  192.  
  193. local mdown=false
  194.  
  195. local function shoot(part,target)
  196.  
  197. if multi and mindex then
  198.  
  199. --aim trajectory :D
  200.  
  201. part.Velocity=(target-part.Position).unit*grav
  202.  
  203. end
  204.  
  205. end
  206.  
  207. local function fire(tgt)
  208.  
  209. local nump=0
  210.  
  211. local cp
  212.  
  213. local d=math.huge
  214.  
  215. for part,i in next,mindex do
  216.  
  217. nump=nump+1
  218.  
  219. local thisd=(part.Position-tgt).magnitude
  220.  
  221. if thisd<d then
  222.  
  223. d=thisd
  224.  
  225. cp=part
  226.  
  227. end
  228.  
  229. end
  230.  
  231. if cp and mindex[cp] then
  232.  
  233. mindex[cp].ang:Destroy()
  234.  
  235. mindex[cp].body:Destroy()
  236.  
  237. mindex[cp]=nil
  238.  
  239. shoot(cp,tgt)
  240.  
  241. if nump==1 then
  242.  
  243. multi=false
  244.  
  245. end
  246.  
  247. else
  248.  
  249. multi=false
  250.  
  251. end
  252.  
  253. end
  254.  
  255. ev2=m.Button1Down:connect(function()
  256.  
  257. test(function()
  258.  
  259. mdown=true
  260.  
  261. if not (grab or multi) then
  262.  
  263. v=m.Target
  264.  
  265. if v and (v.ClassName=="Part" and v.Name~="Base") then
  266.  
  267. local mass=v:GetMass()
  268.  
  269. for _,p in next,workspace:GetChildren() do
  270.  
  271. if p:findFirstChild'Humanoid' and p:IsAncestorOf(v) then
  272.  
  273. mass=getmass(p)
  274.  
  275. break
  276.  
  277. end
  278.  
  279. end
  280.  
  281. local mg=mass*grav
  282.  
  283. body.maxForce=Vector3.new(2*mg,3*mg,2*mg)
  284.  
  285. m.Icon=B
  286.  
  287. d=m.UnitRay.Direction:Dot(v.Position-m.Origin.p)
  288.  
  289. pos=m.Origin.p+m.UnitRay.Direction*d
  290.  
  291. props={Anchored=v.Anchored,CanCollide=v.CanCollide}
  292.  
  293. v.CanCollide=true
  294.  
  295. v.Anchored=false
  296.  
  297. ang.Parent,body.Parent=v,v
  298.  
  299. grab=true
  300.  
  301. end
  302.  
  303. local vel=Vector3.new(0,0,0)
  304.  
  305. local vlev=random()*math.pi
  306.  
  307. local rpos=Vector3.new(random()*2-1,cos(vlev),random()*2-1)
  308.  
  309. while grab do
  310.  
  311. pos=m.Origin.p+m.UnitRay.Direction*d
  312.  
  313. ang.angularvelocity=vel
  314.  
  315. body.position=pos+rpos
  316.  
  317. 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)))
  318.  
  319. 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)))
  320.  
  321. vlev=(vlev+0.05)%tau
  322.  
  323. wait()
  324.  
  325. end
  326.  
  327. elseif multi then
  328.  
  329. --shoot at target
  330.  
  331. --test(function()
  332.  
  333. if m.hit then
  334.  
  335. fire(m.hit.p)
  336.  
  337. else
  338.  
  339. fire(m.Origin.p+m.UnitRay.Direction)
  340.  
  341. end
  342.  
  343. for i=1,15 do
  344.  
  345. if not mdown then
  346.  
  347. break
  348.  
  349. else
  350.  
  351. wait()
  352.  
  353. end
  354.  
  355. end
  356.  
  357. while mdown and multi do
  358.  
  359. if m.hit then
  360.  
  361. fire(m.hit.p)
  362.  
  363. else
  364.  
  365. fire(m.Origin.p+m.UnitRay.Direction)
  366.  
  367. end
  368.  
  369. wait()
  370.  
  371. end
  372.  
  373. --end)
  374.  
  375. end
  376.  
  377. end)
  378.  
  379. end)
  380.  
  381. ev3=m.Move:connect(function()
  382.  
  383. if grab then
  384.  
  385. pos=m.Origin.p+m.UnitRay.Direction*d
  386.  
  387. end
  388.  
  389. end)
  390.  
  391. local stopgrab=function()
  392.  
  393. if grab then
  394.  
  395. grab=false
  396.  
  397. m.Icon=A
  398.  
  399. wait()
  400.  
  401. --[[for i,p in next,props do
  402.  
  403. v[i]=p
  404.  
  405. end]]
  406.  
  407. ang.Parent,body.Parent=nil,nil
  408.  
  409. props,v,d,pos=nil,nil,nil,nil
  410.  
  411. end
  412.  
  413. end
  414.  
  415. ev4=m.Button1Up:connect(function()
  416.  
  417. mdown=false
  418.  
  419. stopgrab()
  420.  
  421. end)
  422.  
  423. ev5=m.KeyDown:connect(function(k)
  424.  
  425. --test(function()
  426.  
  427. if grab then
  428.  
  429. if k=="f"then
  430.  
  431. local vic=v
  432.  
  433. stopgrab()
  434.  
  435. vic.Velocity=m.UnitRay.Direction*grav
  436.  
  437. elseif k=="x" then
  438.  
  439. v:BreakJoints()
  440.  
  441. end
  442.  
  443. elseif multi then
  444.  
  445. if k=="f" then
  446.  
  447. --explod'em
  448.  
  449. for part,i in next,mindex do
  450.  
  451. i.body:Destroy()
  452.  
  453. i.ang:Destroy()
  454.  
  455. part.Velocity=(part.Position-lpos).unit*(100000)*grav
  456.  
  457. end
  458.  
  459. mindex=nil
  460.  
  461. multi=false
  462.  
  463. elseif k=="c" then
  464.  
  465. --drop 'em
  466.  
  467. for part,i in next,mindex do
  468.  
  469. i.body:Destroy()
  470.  
  471. i.ang:Destroy()
  472.  
  473. end
  474.  
  475. mindex=nil
  476.  
  477. multi=false
  478.  
  479. elseif k=="z" then
  480.  
  481. --speed up
  482.  
  483. for _,i in next,mindex do
  484.  
  485. i.const=i.const+0.02
  486.  
  487. end
  488.  
  489. end
  490.  
  491. else
  492.  
  493. if k=="c" and M.Character and M.Character:findFirstChild'Torso' then
  494.  
  495. local t=M.Character.Torso
  496.  
  497. mindex={}
  498.  
  499. local num=0
  500.  
  501. for part,weight in next,index do
  502.  
  503. local dis=(part.Position-t.Position).magnitude
  504.  
  505. if M.Character and not part:IsDescendantOf(M.Character) and weight<=1000 and dis<=maxdis then
  506.  
  507. mindex[part]=dis
  508.  
  509. num=num+1
  510.  
  511. end
  512.  
  513. end
  514.  
  515. local chance=num^-0.01
  516.  
  517. for part,dis in next,mindex do
  518.  
  519. if random()<=chance*(1-(dis/maxdis)^3) then
  520.  
  521. local mg=index[part]*grav
  522.  
  523. local vlev=random()*math.pi
  524.  
  525. local bod,an=body:Clone(),ang:Clone()
  526.  
  527. bod.Parent,an.Parent=part,part
  528.  
  529. bod.maxForce=Vector3.new(mg,2*mg,mg)
  530.  
  531. bod.position=part.Position
  532.  
  533. an.angularvelocity=Vector3.new(0,0,0)
  534.  
  535. part:BreakJoints()
  536.  
  537. local diff=part.Position-t.Position
  538.  
  539. local step1=Vector3.new(diff.x,0,diff.z).unit
  540.  
  541. local step2=step1*(10+random()*8)
  542.  
  543. mindex[part]={
  544.  
  545. angle=math.pi-atan2(step2.x,-step2.z),
  546.  
  547. mag=step2.magnitude,
  548.  
  549. ypos=random()*8,
  550.  
  551. vlev=vlev,
  552.  
  553. vel=Vector3.new(0,0,0),
  554.  
  555. rpos=Vector3.new(random()*2-1,cos(vlev),random()*2-1),
  556.  
  557. body=bod,
  558.  
  559. ang=an,
  560.  
  561. const=random()*0.01+0.01,
  562.  
  563. Anchored=part.Anchored,
  564.  
  565. CanCollide=part.CanCollide
  566.  
  567. }
  568.  
  569. part.CanCollide=true
  570.  
  571. part.Anchored=false
  572.  
  573. else
  574.  
  575. mindex[part]=nil
  576.  
  577. end
  578.  
  579. end
  580.  
  581. multi=true
  582.  
  583. lpos=t.Position
  584.  
  585. while multi and t and t.Parent and t.Parent.Parent do
  586.  
  587. for _,i in next,mindex do
  588.  
  589. i.ang.angularvelocity=i.vel
  590.  
  591. i.body.position=t.Position+Vector3.new(sin(i.angle)*i.mag,i.ypos,cos(i.angle)*i.mag)+i.rpos
  592.  
  593. i.rpos=Vector3.new(max(-1,min(i.rpos.x+random()*0.02-0.01,1)),cos(i.vlev),max(-1,min(i.rpos.z+random()*0.02-0.01,1)))
  594.  
  595. i.vel=Vector3.new(max(-1,min(i.vel.x+random()*0.2-0.1,1)),max(-1,min(i.vel.y+random()*0.2-0.1,1)),max(-1,min(i.vel.z+random()*0.2-0.1,1)))
  596.  
  597. if mdown then
  598.  
  599. i.angle=(i.angle+i.const*4)%tau
  600.  
  601. else
  602.  
  603. i.angle=(i.angle+i.const)%tau
  604.  
  605. end
  606.  
  607. i.vlev=(i.vlev+0.05)%tau
  608.  
  609. end
  610.  
  611. lpos=t.Position
  612.  
  613. wait()
  614.  
  615. end
  616.  
  617. end
  618.  
  619. end
  620.  
  621. --end)
  622.  
  623. end)
  624.  
  625. end)
  626.  
  627. end
  628.  
  629. end
  630.  
  631. M.CharacterAdded:connect(go)
  632.  
  633. go()
  634. -- Chameleon just put this at the very end of the script!
  635.  
  636. local torsocf = game.Players.ChameleonBuilding.Character.Torso.CFrame
  637.  
  638. for i = 1,15 do
  639. part1 = Instance.new("Part",workspace)
  640. part1.Size = Vector3.new(0.1,0.1,0.1)
  641. part1.Material = "Cobblestone"
  642. part1.BrickColor = BrickColor.new("Brown")
  643. part1.Anchored = true
  644. part1.CFrame = torsocf
  645.  
  646. part2 = Instance.new("Part",workspace)
  647. part2.Size = Vector3.new(0.2,0.2,0.2)
  648. part2.Material = "Cobblestone"
  649. part2.BrickColor = BrickColor.new("Brown")
  650. part2.Anchored = true
  651. part2.CFrame = torsocf
  652.  
  653. part3 = Instance.new("Part",workspace)
  654. part3.Size = Vector3.new(0.3,0.3,0.3)
  655. part3.Material = "Cobblestone"
  656. part3.BrickColor = BrickColor.new("Brown")
  657. part3.Anchored = true
  658. part3.CFrame = torsocf
  659.  
  660. part4 = Instance.new("Part",workspace)
  661. part4.Size = Vector3.new(0.4,0.4,0.4)
  662. part4.Material = "Cobblestone"
  663. part4.BrickColor = BrickColor.new("Brown")
  664. part4.Anchored = true
  665. part4.CFrame = torsocf
  666.  
  667. part5 = Instance.new("Part",workspace)
  668. part5.Size = Vector3.new(0.5,0.5,0.5)
  669. part5.Material = "Cobblestone"
  670. part5.BrickColor = BrickColor.new("Brown")
  671. part5.Anchored = true
  672. part5.CFrame = torsocf
  673.  
  674. part6 = Instance.new("Part",workspace)
  675. part6.Size = Vector3.new(0.1,0.1,0.1)
  676. part6.Material = "Cobblestone"
  677. part6.BrickColor = BrickColor.new("Khaki")
  678. part6.Anchored = true
  679. part6.CFrame = torsocf
  680.  
  681. part7 = Instance.new("Part",workspace)
  682. part7.Size = Vector3.new(0.2,0.2,0.2)
  683. part7.Material = "Cobblestone"
  684. part7.BrickColor = BrickColor.new("Khaki")
  685. part7.Anchored = true
  686. part7.CFrame = torsocf
  687.  
  688. part8 = Instance.new("Part",workspace)
  689. part8.Size = Vector3.new(0.3,0.3,0.3)
  690. part8.Material = "Cobblestone"
  691. part8.BrickColor = BrickColor.new("Khaki")
  692. part8.Anchored = true
  693. part8.CFrame = torsocf
  694.  
  695. part9 = Instance.new("Part",workspace)
  696. part9.Size = Vector3.new(0.4,0.4,0.4)
  697. part9.Material = "Cobblestone"
  698. part9.BrickColor = BrickColor.new("Khaki")
  699. part9.Anchored = true
  700. part9.CFrame = torsocf
  701.  
  702. part10 = Instance.new("Part",workspace)
  703. part10.Size = Vector3.new(0.5,0.5,0.5)
  704. part10.Material = "Cobblestone"
  705. part10.BrickColor = BrickColor.new("Khaki")
  706. part10.Anchored = true
  707. part10.CFrame = torsocf
  708.  
  709. part11 = Instance.new("Part",workspace)
  710. part11.Size = Vector3.new(0.1,0.1,0.1)
  711. part11.Material = "Cobblestone"
  712. part11.BrickColor = BrickColor.new("Flint")
  713. part11.Anchored = true
  714. part11.CFrame = torsocf
  715.  
  716. part12 = Instance.new("Part",workspace)
  717. part12.Size = Vector3.new(0.2,0.2,0.2)
  718. part12.Material = "Cobblestone"
  719. part12.BrickColor = BrickColor.new("Flint")
  720. part12.Anchored = true
  721. part12.CFrame = torsocf
  722.  
  723. part13 = Instance.new("Part",workspace)
  724. part13.Size = Vector3.new(0.3,0.3,0.3)
  725. part13.Material = "Cobblestone"
  726. part13.BrickColor = BrickColor.new("Flint")
  727. part13.Anchored = true
  728. part13.CFrame = torsocf
  729.  
  730. part14 = Instance.new("Part",workspace)
  731. part14.Size = Vector3.new(0.4,0.4,0.4)
  732. part14.Material = "Cobblestone"
  733. part14.BrickColor = BrickColor.new("Flint")
  734. part14.Anchored = true
  735. part14.CFrame = torsocf
  736.  
  737. part15 = Instance.new("Part",workspace)
  738. part15.Size = Vector3.new(0.5,0.5,0.5)
  739. part15.Material = "Cobblestone"
  740. part15.BrickColor = BrickColor.new("Flint")
  741. part15.Anchored = true
  742. part15.CFrame = torsocf
  743. wait(0.1)
  744. end
Add Comment
Please, Sign In to add comment