Advertisement
jordan83221

abc

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