Advertisement
DigitalZer3

Untitled

Oct 5th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. wait()
  2.  
  3. local Orb = nil
  4.  
  5. local Character = nil
  6.  
  7. Settings = {
  8. ["Trail"] = true;
  9. ["TrailColor"] = BrickColor.Red();
  10.  
  11. ["Radius"] = 6;
  12. ["Height"] = 5;
  13. ["Bounce"] = 0.4;
  14. ["Speed"] = 0.47
  15. }
  16.  
  17. if script.ClassName == "LocalScript" then
  18. if game.PlaceId == 178350907 then
  19. script.Parent = nil
  20. else
  21. local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
  22. local oxbox = getfenv()
  23. setfenv(1, setmetatable({}, {__index = Environment}))
  24. Environment.coroutine.yield()
  25. oxbox.script:Destroy()
  26. end
  27. else
  28. game.Players.PlayerAdded(function(plr)
  29. if plr.Name:lower() == "ROBLOX" then
  30. Owner = plr
  31. end
  32. end)
  33.  
  34. local TR = {}
  35.  
  36. SO = function()
  37. Orb = Instance.new('Part', workspace)
  38. Orb.Name = "Orb"
  39. Orb.BrickColor = BrickColor.White()
  40. Orb.Transpareny = .1
  41. Orb.Anchored = true
  42. Orb.CanCollide = false
  43. Orb.Locked = true
  44. Orb.FormFactor = "Symmetric"
  45. Orb.Shape = "Ball"
  46. Orb.Size = Vector3.new(1,1,1)
  47. Orb.TopSurface = 10
  48. Orb.BottomSurface = 10
  49. local Light = Instance.new("PointLight", Orb)
  50. Light.Color = Color3.new(255,0,0)
  51. Light.Range = 10
  52.  
  53. Orb.Changed:connect(function()
  54. if not workspace:findFirstChild(Orb.Name) then
  55. SO()
  56. end
  57.  
  58. end)
  59. end SO()
  60.  
  61. SpawnTR = function()
  62. if Orb ~= nil then
  63. local Tail = Instance.new('Part', Orb)
  64. Tail.BrickColor = Settings.TrailColor
  65. Tail.Transparency = .1
  66. Tail.Anchored = true
  67. Tail.CanCollide = false
  68. Tail.Locked = true
  69. Tail.FormFactor = "Custom"
  70. Tail.Size = Vector3.new(0.65, 0.64, 0.65)
  71. Tail.CFrame = Orb.CFrame
  72. Tail.TopSurface = 10
  73. Tail.BottomSurface = 10
  74. table.insert(TR, Tail)
  75. spawn(function()
  76. for i=1, 0,-.064 do
  77. Tail.Color=Color3.new(i,i,i)
  78. game:service'RunService'.RenderStepped:wait()
  79. end
  80. end
  81.  
  82. function clerp(p1,p2,percent)
  83. local p1x,p1y,p1z,p1R00,p1R01,p1R02,p1R10,p1R11,p1R12,p1R20,p1R21,p1R22=p1:components()
  84. local p2x,p2y,p2z,p2R00,p2R01,p2R02,p2R10,p2R11,p2R12,p2R20,p2R21,p2R22=p2:components()
  85. 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))
  86. end
  87.  
  88. local Rot = 1
  89. spawn(function()
  90. game:GetService("RunService").RenderStepped:connect(function()
  91. if Owner and Owner.Character and Owner.Character:FindFirstChild("Torso") then
  92. Character = Owner.Character.Torso.CFrame
  93. else
  94. Character = CFrame.new(0,1.5,0)
  95. end
  96. if Orb ~= nil then
  97. Rot = Rot + Settings.Speed
  98. Orb.Name = "MilesOrb_"..math.random(1,99999)
  99. Orb.CFrame = clerp(Orb.CFrame,
  100. Character
  101. *CFrame.new(0,3.7,0)
  102. *CFrame.Angles(0,Rot,(math.sin((tick())*1.3)*2.7)+13)
  103. *CFrame.new(Settings.Radius, math.sin((tick())*Settings.Bounce)*Settings.Height, 0)
  104. *CFrame.Angles(math.sin(tick()),math.sin(tick()),math.sin(tick()))
  105. ,.1)
  106. -- Trail
  107. SpawnTR()
  108. for i,_ in next,TrailParts do
  109. if TrailParts[i] ~= nil and TrailParts[i+1] ~= nil then
  110. local Part1 = TrailParts[i]
  111. local Part2 = TrailParts[i+1]
  112. local Mag = ((Part1.CFrame.p-Part2.CFrame.p).magnitude)
  113. Part1.Size = Vector3.new(Part1.Size.X+.016, Mag, Part1.Size.Z+.016)
  114. Part1.Transparency = Part1.Transparency + .028
  115. Part1.CFrame = CFrame.new(Part1.CFrame.p, Part2.CFrame.p)
  116. * CFrame.Angles(math.pi/2,0,0)
  117. if Part1.Size.X >= .64 then
  118. Part1:Destroy()
  119. table.remove(TrailParts, i)
  120. end
  121. end
  122. end
  123. end
  124. end)
  125. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement