urabigfatnoob

orb

Aug 28th, 2016
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.79 KB | None | 0 0
  1. --maybe add chat and cmds and guis idk
  2. --COLOR SEQUENCE WOOP
  3. --clerp some parts to target with a trail. use a key to rotate between these moves
  4. --last part to circle. the size is remainder*partsize  how2remainder? remainder = circ-math.floor(circ) woop
  5. plr = game.Players.LocalPlayer
  6. mouse = plr:GetMouse()
  7. chr = plr.Character or plr.CharacterAdded:wait()
  8. chr.Humanoid.JumpPower = 0
  9. local orb = Instance.new('Part',workspace)
  10. local x = 1
  11. local trailmodel = Instance.new('Model',chr)
  12. local renderstepped = game:GetService('RunService').RenderStepped
  13. --trailmodel.ChildAdded:connect(function(c)
  14. --  wait(.5)
  15. --  local cframeval = c.CFrame
  16. --  for i = .5,1,.01 do
  17. --      renderstepped:wait()
  18. --      c.Transparency = i
  19. --      c.Size = Vector3.new(.2/i,.2/i,.2/i)
  20. --      c.CFrame = cframeval
  21. --  end
  22. --  c:Destroy()
  23. --end)
  24.  
  25. local colors = {BrickColor.new(Color3.fromRGB(241, 196, 15)),
  26.                 BrickColor.new(Color3.fromRGB(211, 84, 0)),
  27.                 BrickColor.new(Color3.fromRGB(41, 128, 185)),
  28.                 BrickColor.new(Color3.fromRGB(192, 57, 43)),
  29.                 BrickColor.new(Color3.fromRGB(142, 68, 173)),
  30.                 BrickColor.new(Color3.fromRGB(26, 188, 156)),
  31.                 BrickColor.new(Color3.fromRGB(46, 204, 113))
  32. }
  33. function change_color()
  34.     if x == 7 then
  35.         x = 1
  36.     end
  37.     orb.BrickColor = colors[x]
  38. end
  39.  
  40. orb.Anchored = true
  41. orb.CanCollide = false
  42. orb.BrickColor = colors[1]
  43. orb.Size = Vector3.new(.5,.5,.5)
  44. orb.Material = Enum.Material.Neon
  45. orb.Transparency = 0
  46. orb.Parent = chr
  47. local rad = 4
  48. local circ = 2*math.pi*rad
  49. local n = circ/.5
  50. local rot = 360/n
  51. function spawnorb()
  52.     while true do
  53.         x=x+1
  54.         change_color()
  55.         local random = math.random(0,180)
  56.         local randomB = math.random(0,180)
  57.         for i = 0,n do
  58.             renderstepped:wait()
  59.             change_color()
  60.             orb.CFrame = CFrame.new(chr.Torso.Position)*CFrame.Angles(math.rad(random),math.rad(i*rot),0)*CFrame.new(0,0,4)
  61.             local clone = orb:Clone()
  62.             clone.Parent = trailmodel
  63.             clone.CFrame = orb.CFrame
  64.             local function destroy()
  65.                 wait(.5)
  66.                 local cframeval = clone.CFrame
  67.                 for i = .0,1,.02 do
  68.                     renderstepped:wait()
  69.                     clone.Transparency = i
  70.                     clone.Size = clone.Size - Vector3.new(0.01,0.01,0.01)
  71.                     clone.CFrame = cframeval
  72.                 end
  73.                 clone:Destroy()
  74.             end
  75.         spawn(destroy)
  76.         end
  77.     end
  78. end
  79. spawn(spawnorb)
  80.  
  81. mouse.Button1Down:connect(function()
  82.     local target = mouse.Target
  83.     if target~=nil then
  84.         local h = target.Parent:FindFirstChild('Humanoid')
  85.         local t = target.Parent:FindFirstChild('Torso')
  86.         if h and t then
  87.             local model = Instance.new('Model',workspace)
  88.             t.Anchored = true
  89.             local template = orb:Clone()
  90.             template.Size = Vector3.new(1,1,1)
  91.             local rad = 5
  92.             local circ = 2*math.pi*rad
  93.             local n = circ
  94.             local rot = 720/n
  95.             for i = 0,n*5 do
  96.                 renderstepped:wait()
  97.                 local clone = template:Clone()
  98.                 clone.Transparency = 1
  99.                 local random = math.random(-180,180)
  100.                 local function tran()
  101.                     for i = 1,.5,-.01 do
  102.                         renderstepped:wait()
  103.                         clone.Transparency = i
  104.                     end
  105.                 end
  106.                 spawn(tran)
  107.                 clone.CFrame = t.CFrame*CFrame.Angles(0,math.rad(i*rot),math.rad(random))*CFrame.new(5,0,rad)
  108.                 clone.BrickColor = colors[math.random(1,6)]
  109.                 clone.Parent = model
  110.                 clone.CanCollide = true
  111.             end
  112.             local lerpval = {}
  113.             local child = model:GetChildren()
  114.             for i,v in pairs(child) do
  115.                 table.insert(lerpval,i,v.CFrame)
  116.             end
  117.             for i = 0,1,.01 do
  118.                 renderstepped:wait()
  119.                 h:TakeDamage(math.random(1,2))
  120.                 for n,v in pairs(child) do
  121.                     v.CFrame = lerpval[n]:lerp(t.CFrame,i)
  122.                 end
  123.             end
  124.             model:Destroy()
  125.         end
  126.     end
  127. end)
  128.  
  129. mouse.KeyDown:connect(function(key)
  130.     if key == ' ' then
  131.         local function bodypartclone()
  132.             renderstepped:wait()
  133.             local bodypart = orb:Clone()
  134.             bodypart.Shape = 'Block'
  135.             bodypart.Material = Enum.Material.Neon
  136.             bodypart.BrickColor = BrickColor.new(1,1,1)
  137.             bodypart.CanCollide = false
  138.             bodypart.Anchored = true
  139.             bodypart.Transparency = .9
  140.             local model = Instance.new("Model",workspace)
  141.             model.ChildAdded:connect(function(c)
  142.                 local function tran()
  143.                     local cframeval = chr.Torso.CFrame
  144.                     model.PrimaryPart = model.Torso
  145.                     for i = .1,1.01,.01 do
  146.                         renderstepped:wait()
  147.                         c.Transparency = i
  148.                         model:SetPrimaryPartCFrame(cframeval:lerp(chr.Torso.CFrame,i))
  149.                     end
  150.                     c:Destroy()
  151.                 end
  152.                 spawn(tran)
  153.             end)
  154.             model.Name = "fake supercoolguy53"
  155.             local child = chr:GetChildren()
  156.             for i,v in pairs(child) do
  157.                 if v.ClassName == "Part" and v.Name ~= "Head" and v.Name ~= "Handle" and v.Name ~= 'Part' and v~=handsphereA and v~=handsphereB then
  158.                     local size = v.Size
  159.    
  160.                     local cframe = v.CFrame
  161.                     local clone = bodypart:Clone()
  162.                     clone.Size = size
  163.                     if v == chr.Torso then
  164.                         clone.Name = 'Torso'
  165.                     end
  166.                     clone.CFrame = cframe
  167.                     clone.Parent = model
  168.                 end
  169.             end
  170.             repeat wait() local mchild = model:GetChildren() until #mchild == 0
  171.             model:Destroy()
  172.         end
  173.         if mouse.Target ~= nil then
  174.             spawn(bodypartclone)
  175.             wait()
  176.             chr:MoveTo(mouse.Hit.p)
  177.         end
  178.     end
  179. end)
Advertisement
Add Comment
Please, Sign In to add comment