Advertisement
jordan83221

Aero 1.2

Dec 9th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.71 KB | None | 0 0
  1. script.Parent=nil
  2. script.Name="eungorb"
  3. local start
  4. local plrs=game.Players:GetPlayers()
  5. local link=nil
  6. local ro=true
  7. local sur=false
  8. local pro=false
  9. local protected
  10. local ease=0.3
  11. local leader
  12. local att=nil
  13. local orbParts={}
  14. local surrounded
  15. local me=game.Players.Voreli
  16. leader=Instance.new("Part",workspace)
  17. leader.Name="EungLeader"
  18. leader.Anchored=true
  19. leader.Size=Vector3.new(2,2,2)
  20. leader.Shape="Ball"
  21. leader.CanCollide=false
  22. leader.Transparency=1
  23. local pi=math.pi
  24. local arrows={}
  25. local tabs={}
  26. color="Really black" -- Feel free to change the color to whatever you'd like.
  27. local pointsz={
  28.     CFrame.new(0,0,0),
  29.     CFrame.new(2,33,2),
  30.     CFrame.new(-11,35,-22)
  31. }
  32. local function newPoint(cframe)
  33.     table.insert(pointsz,cframe)
  34. end
  35. local function newArrow()
  36.     local arrow=Instance.new("Part",workspace)
  37.     arrow.Name="EungArrow"
  38.     arrow.Anchored=true
  39.     arrow.Material="Plastic"
  40.     arrow.Anchored=true
  41.     arrow.CanCollide=false
  42.     arrow.Size=Vector3.new(1, 0.4, 2)
  43.     arrow.Transparency=1
  44.     local mesh=Instance.new("SpecialMesh",arrow)
  45.     mesh.MeshId="http://www.roblox.com/asset/?id=15887356"
  46.     mesh.MeshType="FileMesh"
  47.     mesh.Scale=Vector3.new(-1, 1, -1.5)
  48.     mesh.TextureId="http://www.roblox.com/asset/?id=15886781"
  49.     table.insert(tabs,arrow)
  50. end
  51. local t=0
  52. local function wipe(tab)
  53.     for i=1,#tab do
  54.         table.remove(tab,i)
  55.     end
  56. end
  57. local link=nil
  58. local cmds={
  59.     ["fol"]=function(p)
  60.         for _,v in next,game.Players:GetPlayers() do
  61.             if string.find(v.Name:lower(),p:lower()) ~= nil then
  62.                 pcall(function()
  63.                     sur=false
  64.                     ro=true
  65.                     link=v.Character.Torso
  66.                     att=nil
  67.                 end)
  68.             end
  69.         end
  70.     end,
  71.     ["sur"]=function(p)
  72.         for _,v in next,game.Players:GetPlayers() do
  73.             if string.find(v.Name:lower(),p:lower()) ~= nil then
  74.                 pcall(function()
  75.                     ro=false
  76.                     pro=false
  77.                     sur=true
  78.                     surrounded=v
  79.                 end)
  80.             end
  81.         end
  82.     end,
  83.     ["kill"]=function(p)
  84.         for _,v in next,game.Players:GetPlayers() do
  85.             if string.find(v.Name:lower(),p:lower()) ~= nil then
  86.                 pcall(function()
  87.                     att=nil
  88.                     v.Character.Torso.Anchored=true
  89.                     kill(v)
  90.                 end)
  91.             end
  92.         end
  93.     end,
  94.     ["attack"]=function(p)
  95.         for _,v in next,game.Players:GetPlayers() do
  96.             if string.find(v.Name:lower(),p:lower()) ~= nil then
  97.                 pcall(function()
  98.                     att=v.Character.Torso
  99.                     link=v.Character.Torso
  100.                 end)
  101.             end
  102.         end
  103.     end,
  104.     ["protect"]=function(p)
  105.         for _,v in next,game.Players:GetPlayers() do
  106.             if string.find(v.Name:lower(),p:lower())~=nil then
  107.                 pcall(function()
  108.                     for i=1,10 do wait()
  109.                         newArrow()
  110.                     end
  111.                     protected=v
  112.                     protect(v)
  113.                 end)
  114.             end
  115.         end
  116.     end
  117. }
  118. function remove(tab,val)
  119.     for i=1,#tab do
  120.         if tab[i]==val then
  121.             table.remove(tab,i)
  122.             break
  123.         end
  124.     end
  125. end
  126. function dist(part1,part2)
  127.     return (part1-part2).magnitude
  128. end
  129. local function easey(part,cframe)
  130.     while wait() do
  131.         local arrow=Instance.new("Part",workspace)
  132.         arrow.Name="EungArrow"
  133.         arrow.Anchored=true
  134.         arrow.Material="Plastic"
  135.         arrow.Anchored=true
  136.         arrow.CanCollide=false
  137.         arrow.Size=Vector3.new(1, 0.4, 2)
  138.         arrow.Transparency=1
  139.         local mesh=Instance.new("SpecialMesh",arrow)
  140.         mesh.MeshId="http://www.roblox.com/asset/?id=15887356"
  141.         mesh.MeshType="FileMesh"
  142.         mesh.Scale=Vector3.new(-1, 1, -1.5)
  143.         mesh.TextureId="http://www.roblox.com/asset/?id=15886781"
  144.         table.insert(arrows,arrow)
  145.         local dx=cframe.X-part.CFrame.X
  146.         local dy=cframe.Y-part.CFrame.Y
  147.         local dz=cframe.Z-part.CFrame.Z
  148.         local vx=dx*ease;
  149.         local vy=dy*ease;
  150.         local vz=dz*ease
  151.         if dist(part.Position,Vector3.new(cframe.X,cframe.Y,cframe.Z))>1 then
  152.             part.CFrame=CFrame.new(part.CFrame.X+vx,part.CFrame.Y+vy,part.CFrame.Z+vz)
  153.             arrow.CFrame=CFrame.new(part.CFrame.X+vx,part.CFrame.Y+vy,part.CFrame.Z+vz)
  154.             wait(0.05)
  155.             arrow.CFrame=CFrame.new(arrow.Position,Vector3.new(cframe.X,cframe.Y,cframe.Z))
  156.             coroutine.resume(coroutine.create(function()
  157.                 for i=0,1,0.09 do wait()
  158.                     arrow.Transparency=i
  159.                 end
  160.                 arrow:Destroy()
  161.                 remove(arrows,arrow)
  162.             end))
  163.         else
  164.             break
  165.         end
  166.     end
  167. end
  168. function protect(plr)
  169.     if pro and protected then
  170.         for i,v in next,tabs do
  171.             local x=math.cos(i*(pi*2)/#tabs)*(2+#tabs);
  172.             local y=0
  173.             local z=math.sin(i*(pi*2)/#tabs)*(2+#tabs);
  174.             easey(v,protected.Torso.CFrame*CFrame.new(x,y,z))
  175.             wait(0.05)
  176.             v.CFrame=CFrame.new(v.CFrame.p,protected.Torso.CFrame.p)
  177.         end
  178.     end
  179. end
  180. local function checkGood(p0,p1,p2)
  181.     local part=Instance.new("Part",workspace)
  182.     part.Transparency=1
  183.     part.Anchored=true
  184.     part.CanCollide=false
  185.     for i=0,1,0.01 do
  186.         part.CFrame=p0:lerp(p1,i):lerp(p2,i)
  187.         if part.CFrame==me.Torso.CFrame then
  188.             return false
  189.         else
  190.             return true
  191.         end
  192.     end
  193. end
  194. local function quadCurve(p0,p1,p2,t)
  195.     local arrow=Instance.new("Part",workspace)
  196.     arrow.Name="EungArrow"
  197.     arrow.Anchored=true
  198.     arrow.Material="Plastic"
  199.     arrow.Anchored=true
  200.     arrow.Size=Vector3.new(1, 0.4, 2)
  201.     arrow.Transparency=1
  202.     arrow.CanCollide=false
  203.     local mesh=Instance.new("SpecialMesh",arrow)
  204.     mesh.MeshId="http://www.roblox.com/asset/?id=15887356"
  205.     mesh.MeshType="FileMesh"
  206.     mesh.Scale=Vector3.new(-1, 1, -1.5)
  207.     mesh.TextureId="http://www.roblox.com/asset/?id=15886781"
  208.     arrow.CFrame=CFrame.new(5,5,5)
  209.     table.insert(arrows,arrow)
  210.     local pFinalX=math.pow(1-t,2)*p0.x+(1-t)*2*t*p1.x+t*t*p2.x;
  211.     local pFinalY=math.pow(1-t,2)*p0.y+(1-t)*2*t*p1.y+t*t*p2.y;
  212.     local pFinalZ=math.pow(1-t,2)*p0.z+(1-t)*2*t*p1.z+t*t*p2.z;
  213.     leader.CFrame=CFrame.new(pFinalX,pFinalY,pFinalZ)
  214.     arrow.CFrame=CFrame.new(pFinalX,pFinalY,pFinalZ)
  215.     wait(0.05)
  216.     arrow.CFrame=CFrame.new(arrow.Position,Vector3.new(leader.CFrame.X,leader.CFrame.Y,leader.CFrame.Z))
  217.     coroutine.resume(coroutine.create(function()
  218.         for i=0,1,0.09 do wait()
  219.             arrow.Transparency=i
  220.         end
  221.         arrow:Destroy()
  222.         remove(arrows,arrow)
  223.     end))
  224. end
  225. local start
  226. local sec
  227. local function multiCurve(beginning,points)
  228.     local p0z,p1z,p2z,midx,midy,midz
  229.     p0z=beginning
  230.     p1z = points[2];
  231.     p2z = points[3];
  232.     midx=(p1z.x+p2z.x)/2;
  233.     midy=(p1z.y+p2z.y)/2;
  234.     midz=(p1z.z+p2z.z)/2;
  235.     sec=p2z
  236.     start=CFrame.new(midx,midy,midz)
  237.     quadCurve(p0z,p1z,start,t)
  238. end
  239. local xangle=0
  240. local yangle=0
  241. local xspeed=0.05
  242. local yspeed=0.06
  243. local radius=5
  244. local g=0
  245. function surround()
  246.     if sur and surrounded then
  247.         ro=false
  248.         local x=math.cos(xangle)*radius;
  249.         local y=math.sin(tick())*2;
  250.         local z=math.sin(yangle)*radius;
  251.         easey(leader,CFrame.new(x,y,z))
  252.         xangle=xangle+xspeed
  253.         yangle=yangle+yspeed
  254.     end
  255. end
  256. function kill(plr)
  257.     ro=false
  258.     if plr then
  259.         easey(leader,plr.Character.Torso.CFrame)
  260.         plr.Character:BreakJoints()
  261.         if link~=nil then
  262.             easey(leader,link.CFrame*CFrame.new(5,0,0))
  263.         else
  264.             easey(leader,CFrame.new(5,0,0))
  265.         end
  266.         ro=true
  267.     end
  268. end
  269. local function rot()
  270.     if game.Workspace:findFirstChild("EungLeader") then
  271.         if ro==true then
  272.             if t<=1 then
  273.                 multiCurve(pointsz[1],pointsz)
  274.                 if link==nil then
  275.                     t=t+0.005
  276.                 else
  277.                     t=t+0.025
  278.                 end
  279.             else
  280.                 pointsz[1]=(CFrame.new(start.X,start.Y,start.Z))
  281.                 pointsz[2]=(CFrame.new(sec.X,sec.Y,sec.Z))
  282.                 local x=math.random(-50,50)
  283.                 local y=math.random(0,50)
  284.                 local z=math.random(-50,50)
  285.                 local xw=math.random(-17,17)
  286.                 local yw=math.random(0,17)
  287.                 local zw=math.random(-17,17)
  288.                 local xa=math.random(-1,1)
  289.                 local ya=math.random(0,1)
  290.                 local za=math.random(-1,1)
  291.                 if link==nil and att==nil then
  292.                     pointsz[3]=(CFrame.new(x,y,z))
  293.                 elseif link~=nil and att==nil then
  294.                     pointsz[3]=(link.CFrame*CFrame.new(xw,yw,zw))
  295.                 elseif link~=nil and att~=nil then
  296.                     pointsz[3]=(link.CFrame*CFrame.new(xa,ya,za))
  297.                     leader.Touched:connect(function(hit)
  298.                         if hit.Name~="EungArrow" then
  299.                             if att~=nil then
  300.                                 hit:Destroy()
  301.                             end
  302.                         end
  303.                     end)
  304.                 end
  305.                 t=0
  306.             end
  307.         end
  308.     else
  309.         leader=Instance.new("Part",workspace)
  310.         leader.Name="EungLeader"
  311.         leader.Anchored=true
  312.         leader.Material=Enum.Material.Neon
  313.         leader.BrickColor=BrickColor.new(color)
  314.         leader.Size=Vector3.new(2,2,2)
  315.         leader.Shape="Ball"
  316.         leader.CanCollide=false
  317.         leader.Transparency=1
  318.     end
  319. end
  320. game:service'RunService'.RenderStepped:connect(function() rot() surround() end)
  321. me.Character.Humanoid.Died:connect(function()
  322.     link=nil
  323.     wait(6)
  324.     link=me.Character.Torso
  325. end)
  326. local function chatted(msg)
  327.     local cmd,parm=string.match(msg,"(.*)/(.*)")
  328.     if cmd and parm and cmds[cmd] then
  329.         cmds[cmd](parm)
  330.     end
  331. end
  332. local function playerAdded(player)
  333.     if player==me then
  334.         player.Chatted:connect(function(m) chatted(m) end)
  335.     end
  336. end
  337.  
  338. game.Players.PlayerAdded:connect(playerAdded)
  339. for _,v in next,plrs do
  340.     playerAdded(v)
  341. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement