Advertisement
seb8023

Orb V2

Jul 2nd, 2015
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  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. local Owner = game:GetService("Players").LocalPlayer
  10.  
  11. local Character = nil
  12. local Orb = nil
  13.  
  14. local Settings = {
  15. ["Trail"] = true,
  16. ["TrailColor"] = BrickColor.Green(),
  17.  
  18. ["Radius"] = 7,
  19. ["Height"] = 1.2,
  20. ["Bounce"] = 2.7,
  21.  
  22. ["AudioID"] = 9,
  23.  
  24. ["Sounds"] = {
  25. 163880175,
  26. 173785871,
  27. 187197902,
  28. 246448600,
  29. 160666496,
  30. 155076577,
  31. 257275814
  32. },
  33.  
  34. ["Speed"] = 88
  35. }
  36.  
  37. Owner.Chatted:connect(function(msg)
  38. if msg:lower():sub(1,3) == "/e " then
  39. msg = msg:sub(4)
  40. end
  41. if msg:lower():sub(1,6) == "speed " then
  42. msg = tonumber(".0"..msg:sub(7))
  43. Settings.Speed = tonumber(msg)
  44. elseif msg:lower():sub(1,7) == "bounce " then
  45. msg = tonumber(msg:sub(8))
  46. Settings.Speed = tonumber(msg)
  47. elseif msg:lower():sub(1,7) == "height " then
  48. msg = tonumber(msg:sub(8))
  49. Settings.Height = tonumber(msg)
  50. elseif msg:lower():sub(1,5) == "trail" then
  51. if Settings.Trail == true then
  52. Settings.Trail = false
  53. else
  54. Settings.Trail = true
  55. end
  56. end
  57. end)
  58.  
  59. if script.ClassName == "LocalScript" then
  60. if game.PlaceId == 178350907 then
  61. script.Parent = nil
  62. else
  63. local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
  64. local oxbox = getfenv()
  65. setfenv(1, setmetatable({}, {__index = Environment}))
  66. Environment.coroutine.yield()
  67. oxbox.script:Destroy()
  68. end
  69. else
  70. game.Players.PlayerAdded:connect(function(plr)
  71. if plr.Name:lower() == "seb8023" then
  72. Owner = plr
  73. end
  74. end)
  75. script:Destroy()
  76. end
  77.  
  78. local TrailParts = {}
  79.  
  80. Spawnorb = function()
  81. Settings.AudioID = Settings.Sounds[math.random(1, #Settings.Sounds)]
  82. if Orb ~= nil then
  83. pcall(function()
  84. Orb:ClearAllChildren()
  85. end)
  86. pcall(function()
  87. Orb:Destroy()
  88. end)
  89. end
  90. Orb = Instance.new('Part', workspace)
  91. Orb.BrickColor = BrickColor.Green()
  92. Orb.Transparency = 0
  93. Orb.Anchored = true
  94. Orb.CanCollide = false
  95. Orb.Locked = true
  96. Orb.FormFactor = "Symmetric"
  97. Orb.Shape = "Ball"
  98. Orb.Size = Vector3.new(1,1,1)
  99. Orb.TopSurface = 10
  100. Orb.BottomSurface = 10
  101. local Sound = Instance.new("Sound", Orb)
  102. Sound.SoundId = "rbxassetid://"..Settings.AudioID
  103. Sound.Volume = 1
  104. Sound.Pitch = 1
  105. Sound.Looped = true
  106. wait()
  107. Sound:Play()
  108. Orb.Changed:connect(function()
  109. if not workspace:FindFirstChild(Orb.Name) then
  110. Spawnorb()
  111. end
  112. end)
  113. end Spawnorb()
  114.  
  115. Spawntrail = function()
  116. if Orb ~= nil and Settings.Trail == true then
  117. local Tail = Instance.new('Part', Orb)
  118. Tail.BrickColor = Settings.TrailColor
  119. Tail.Transparency = 0
  120. Tail.Anchored = true
  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 = 1
  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 = "SebsOrb_"..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, 0)
  160. *CFrame.Angles(math.sin(tick()),math.sin(tick()),math.sin(tick()))
  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 + 0
  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