Advertisement
BmanExoni

{Insert ORB here}

Jul 4th, 2015
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Dont worry, we arnt gone ;)
  2.  
  3. -- Miles orb
  4. -- Build : 3
  5. -- Made by jillmiles1
  6. -- Server / Client orb
  7.  
  8. wait()
  9. i = 2
  10. local Owner = game:GetService("Players").LocalPlayer
  11.  
  12. local Character = nil
  13. local Orb = nil
  14.  
  15. local Settings = {
  16.     ["Trail"] = true,
  17.     ["TrailColor"] = BrickColor.random(),
  18.    
  19.     ["Radius"] = 0.5,
  20.     ["Height"] = 2,
  21.     ["Bounce"] = 2,
  22.    
  23.     ["AudioID"] = 9,
  24.    
  25.     ["Sounds"] = {
  26.         203654824,
  27.         257157064,
  28.         139819412,
  29.         160442087,
  30.         274504661
  31.     },
  32.    
  33.     ["Speed"] = 4
  34. }
  35.  
  36. Owner.Chatted:connect(function(msg)
  37.     if msg:lower():sub(1,3) == "/e " then
  38.        msg = msg:sub(4)
  39.     end
  40.     if msg:lower():sub(1,6) == "speed " then
  41.        msg = tonumber(".0"..msg:sub(7))
  42.        Settings.Speed = tonumber(msg)
  43.     elseif msg:lower():sub(1,7) == "bounce " then
  44.        msg = tonumber(msg:sub(8))
  45.        Settings.Speed = tonumber(msg)
  46.     elseif msg:lower():sub(1,7) == "height " then
  47.        msg = tonumber(msg:sub(8))
  48.        Settings.Height = tonumber(msg)
  49.     elseif msg:lower():sub(1,5) == "trail" then
  50.         if Settings.Trail == true then
  51.             Settings.Trail = false
  52.         else
  53.             Settings.Trail = true
  54.         end
  55.     end
  56. end)
  57.  
  58. if script.ClassName == "LocalScript" then
  59.     if game.PlaceId == 178350907 then
  60.        script.Parent = nil
  61.     else
  62.         local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
  63.         local oxbox = getfenv()
  64.         setfenv(1, setmetatable({}, {__index = Environment}))
  65.         Environment.coroutine.yield()
  66.         oxbox.script:Destroy()
  67.     end
  68. else
  69.     game.Players.PlayerAdded:connect(function(plr)
  70.       if plr.Name:lower() == "Control22" then
  71.          Owner = plr
  72.       end
  73.     end)
  74.     script:Destroy()
  75. end
  76.  
  77. local TrailParts = {}
  78.  
  79. Spawnorb = function()
  80.     Settings.AudioID = Settings.Sounds[math.random(1, #Settings.Sounds)]
  81.     if Orb ~= nil then
  82.         pcall(function()
  83.             Orb:ClearAllChildren()
  84.         end)
  85.         pcall(function()
  86.             Orb:Destroy()
  87.         end)
  88.     end
  89.     Orb = Instance.new('Part', workspace)
  90.     Orb.BrickColor = BrickColor.White()
  91.     Orb.Transparency = .1
  92.     Orb.Anchored = true
  93.     Orb.CanCollide = false
  94.     Orb.Locked = true
  95.     Orb.FormFactor = "Symmetric"
  96.     Orb.Shape = "Ball"
  97.     Orb.Size = Vector3.new(1,1,1)
  98.     Orb.TopSurface = 10
  99.     Orb.BottomSurface = 10
  100.     local Sound = Instance.new("Sound", Orb)
  101.     Sound.SoundId = "rbxassetid://"..Settings.AudioID
  102.     Sound.Volume = 1
  103.     Sound.Pitch = 1
  104.     Sound.Looped = true
  105.     wait()
  106.     Sound:Play()
  107.     Orb.Changed:connect(function()
  108.         if not workspace:FindFirstChild(Orb.Name) then
  109.             Spawnorb()
  110.         end
  111.     end)
  112. end Spawnorb()
  113.  
  114. Spawntrail = function()
  115.     if Orb ~= nil and Settings.Trail == true then
  116.         local Tail = Instance.new('Part', Orb)
  117.         Tail.BrickColor = Settings.TrailColor
  118.         Tail.Transparency = .1
  119.         Tail.Anchored = true
  120.         Tail.Material = "Neon"
  121.         Tail.CanCollide = false
  122.         Tail.Locked = true
  123.         Tail.FormFactor = "Custom"
  124.         Tail.Size = Vector3.new(.2,.2,.2)
  125.         Tail.CFrame = Orb.CFrame
  126.         Tail.TopSurface = 10
  127.         Tail.BottomSurface = 10
  128.         table.insert(TrailParts, Tail)
  129.         spawn(function()
  130.             for i=1, 0,-.064 do
  131.                 Tail.Color=Color3.new(i,i,i)
  132.                 game:service'RunService'.RenderStepped:wait()
  133.             end
  134.         end)
  135.     end
  136. end
  137.  
  138. function clerp(p1,p2,percent)
  139.     local p1x,p1y,p1z,p1R00,p1R01,p1R02,p1R10,p1R11,p1R12,p1R20,p1R21,p1R22=p1:components()
  140.     local p2x,p2y,p2z,p2R00,p2R01,p2R02,p2R10,p2R11,p2R12,p2R20,p2R21,p2R22=p2:components()
  141.     return CFrame.new(p1x+percent*(p2x-p1x),p1y+percent*(p2y-p1y),p1z+percent*(p2z-p1z),p1R00+percent*(p2R00-p1R00),p1R01+percent*(p2R01-p1R01),p1R02+percent*(p2R02-p1R02),p1R10+percent*(p2R10-p1R10),p1R11+percent*(p2R11-p1R11),p1R12+percent*(p2R12-p1R12),p1R20+percent*(p2R20-p1R20),p1R21+percent*(p2R21-p1R21),p1R22+percent*(p2R22-p1R22))
  142. end
  143.  
  144. local Rot = 30
  145. spawn(function()
  146.     game:GetService("RunService").RenderStepped:connect(function()
  147.         if Owner and Owner.Character and Owner.Character:FindFirstChild("Torso") then
  148.             Character = Owner.Character.Torso.CFrame
  149.         else
  150.             Character = CFrame.new(0,1.5,0)
  151.         end
  152.         if Orb ~= nil then
  153.             Rot = Rot + Settings.Speed
  154.             Orb.Name = "MilesOrb_"..math.random(1,99999)
  155.             Orb.CFrame = clerp(Orb.CFrame,
  156.                 Character
  157.                 *CFrame.new(0,3.7,0)
  158.                 *CFrame.Angles(0,Rot,(math.sin((tick())*1.3)*2.7)+13)
  159.                 *CFrame.new(Settings.Radius, math.sin((tick())*Settings.Bounce)*Settings.Height, 2)
  160.                 *CFrame.fromEulerAnglesXYZ(-math.sin(math.rad(i)),math.rad(i),2) *CFrame.new(8,4,1)
  161.             ,.1)
  162.             -- Trail
  163.             Spawntrail()
  164.             for i,_ in next,TrailParts do
  165.                 if TrailParts[i] ~= nil and TrailParts[i+1] ~= nil then
  166.                     local Part1 = TrailParts[i]
  167.                     local Part2 = TrailParts[i+1]
  168.                     local Mag = ((Part1.CFrame.p-Part2.CFrame.p).magnitude)
  169.                     Part1.Size = Vector3.new(Part1.Size.X+.016, Mag, Part1.Size.Z+.016)
  170.                     Part1.Transparency = Part1.Transparency + .028
  171.                     Part1.CFrame = CFrame.new(Part1.CFrame.p, Part2.CFrame.p)
  172.                     * CFrame.Angles(math.pi/2,0,0)
  173.                     if Part1.Size.X >= .64 then
  174.                         Part1:Destroy()
  175.                         table.remove(TrailParts, i)
  176.                     end
  177.                 end
  178.             end
  179.         end
  180.     end)
  181. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement