jordan83221

Eung

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