Advertisement
reizayah

Untitled

Jan 26th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. --
  2. --
  3. --
  4. --
  5. clerp = function(c1,c2,al)
  6. local function lerp(a,b,c)
  7. return a+(b-a)*c
  8. end
  9. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  10. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  11. for i,v in pairs(com1) do
  12. com1[i] = lerp(v,com2[i],al)
  13. end
  14. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  15. end;
  16.  
  17. local getHue = function(Hue)
  18. local section = Hue % 1 * 3
  19. local secondary = 0.5 * math.pi * (section % 1)
  20. if section < 1 then
  21. return Color3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
  22. elseif section < 2 then
  23. return Color3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
  24. else
  25. return Color3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
  26. end
  27. end
  28.  
  29. local Colors = {'Red','Green','Blue'}
  30. local Player = game.Players.LocalPlayer
  31. local Char = Player.Character
  32. local Part = Char.Head
  33. local Run = game:service'RunService'
  34. local Orbs = {}
  35. local Num = 1
  36. local check = 1
  37. local Credit = false
  38.  
  39. Rotate = function()
  40. math.randomseed(math.random(Num,tick()))
  41. check = check + 1
  42. for i = 1, #Orbs do
  43. coroutine.wrap(function()
  44. pcall(function()
  45. if Part == nil then
  46. Part = game.Players.LocalPlayer.Character:WaitforChild'Head'
  47. end
  48. local Orb = Orbs[i]
  49. if Orb == nil or Orb.Parent == nil then
  50. for Count = 1, #Orbs do
  51. if Orbs[Count] == Orb then
  52. table.remove(Orbs,Count)
  53.  
  54. return
  55. end
  56. end
  57. end
  58. if Credit == false then
  59. game:service'Chat':Chat(Orb,'Made by iiQeQ for '..Player.Name,Colors[math.random(1,#Colors)])
  60. if Num == 2 or Num == 4 then
  61. Credit = true
  62. end
  63. end
  64. local Light = Orb.PointLight
  65. Num = Num + .5
  66. local cframe = CFrame.new(Part.Position.X,Part.Position.Y,Part.Position.Z) * CFrame.Angles(math.sin((90)*(i/.25)+(#Orbs*2)),math.rad((360/#Orbs)*i+(Num/#Orbs)),math.cos((180/#Orbs)*i+(#Orbs*2))) * CFrame.new(0,0,2.5+#Orbs/1.5)
  67. Orb.CFrame = clerp(Orb.CFrame,cframe,.025)
  68. Orb.Rotation = Vector3.new(math.rad(tick()*#Orbs),0, math.rad(tick()-#Orbs*Num)) --(math.rad(tick()*#Orbs),#Orbs+Num, math.rad(tick()-#Orbs*Num))
  69. if check % 2 == 0 then
  70. local Copy = Orb:Clone()
  71. Copy:ClearAllChildren()
  72. Copy.Size = Vector3.new(.25,.25,.25)
  73. Copy.Parent = Orb.Parent
  74. delay(2,function()
  75. for d = 1, 10 do
  76. Copy.size = Copy.Size + Vector3.new(.05,.05,.05)
  77. Copy.Transparency = Copy.Transparency + .05
  78. Run.Heartbeat:wait()
  79. end
  80. Copy:Destroy()
  81. end)
  82. end
  83. Light.Color = getHue(tick()/2)
  84. Orb.BrickColor = BrickColor.new(Light.Color.r,Light.Color.g,Light.Color.b)
  85.  
  86. end)
  87. end)()
  88. end
  89. end
  90.  
  91. Player.Chatted:connect(function(msg)
  92.  
  93. pcall(function()
  94. if msg:sub(1,1) == '|' then
  95. loop = tonumber(msg:sub(2))
  96. for i = 1, loop do
  97.  
  98. Run.RenderStepped:wait()
  99. local Orb = Instance.new('Part')
  100. Orb.BrickColor = BrickColor.White()
  101. Orb.Size = Vector3.new(1,1,1)
  102. Orb.FormFactor = 'Custom'
  103. Orb.Shape = 'Block'
  104. Orb.Name = math.rad(math.sin(tick()))
  105. Orb.Anchored = true
  106. Orb.CanCollide = false
  107. Orb.BottomSurface,Orb.TopSurface = 'Smooth','Smooth'
  108. Orb.Transparency = .5
  109. Orb.CFrame = Part.CFrame
  110. local Click = Instance.new('ClickDetector',Orb)
  111. Click.MaxActivationDistance = math.huge
  112. local Light = Instance.new('PointLight',Orb)
  113. Light.Shadows = true
  114. Light.Range = 8
  115. Light.Brightness = 5
  116. table.insert(Orbs,Orb)
  117. Orb.Parent = workspace
  118.  
  119. Click.MouseHoverEnter:connect(function(plr)
  120. if plr == Player then
  121. for i = 1, 5 do
  122. Orb.Size = Orb.Size + Vector3.new(.05,.05,.05)
  123. Run.RenderStepped:wait()
  124. end
  125. end
  126. end)
  127. Click.MouseHoverLeave:connect(function(plr)
  128. if plr == Player then
  129. for i = 1, 5 do
  130. Orb.Size = Orb.Size + Vector3.new(-.05,-.05,-.05)
  131. Run.RenderStepped:wait()
  132. end
  133. end
  134. end)
  135. Click.MouseClick:connect(function(plr)
  136. if plr == Player then
  137. Orb:Destroy()
  138. -- Lasso:Destroy()
  139. end
  140. end)
  141. end
  142. else--_G
  143. game:service'Chat':Chat(Orbs[math.random(1,#Orbs)],msg,Colors[math.random(1,#Colors)])
  144. end -- Nil value
  145. --Setfenv
  146. end)--Getfenv
  147. end)
  148. Run.RenderStepped:connect(Rotate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement