Advertisement
naser2345

Rainbow man

Aug 8th, 2016
1,836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. -- made by naser2018 ---
  2. Parts={}
  3. function GetDiscoColor(hue)
  4. local section = hue % 1 * 3
  5. local secondary = 0.5 * math.pi * (section % 1)
  6. if section < 1 then
  7. return Vector3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
  8. elseif section < 2 then
  9. return Vector3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
  10. else
  11. return Vector3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
  12. end
  13. end
  14. Part = function(x,y,z,color,tr,cc,an,parent)
  15. local p = Instance.new('Part',parent or Weapon)
  16. p.formFactor = 'Custom'
  17. p.Size = Vector3.new(x,y,z)
  18. p.BrickColor = BrickColor.new(color)
  19. p.CanCollide = cc
  20. p.Transparency = tr
  21. p.Anchored = an
  22. p.TopSurface,p.BottomSurface = 0,0
  23. p:BreakJoints''
  24. table.insert(Parts,p)
  25. return p
  26. end
  27. Weld = function(p0,p1)
  28. local w = Instance.new('Motor',p0)
  29. w.Part0 = p0
  30. w.Part1 = p1
  31. return w
  32. end
  33. Mesh = function(par,num,x,y,z)
  34. local msh = 0
  35. if num == 1 then
  36. msh = Instance.new("SpecialMesh",par)
  37. msh.MeshId='rbxasset://fonts/torso.mesh'
  38. msh.TextureId='rbxasset://25701026'
  39. end
  40. if num == 2 then
  41. msh = Instance.new("SpecialMesh",par)
  42. msh.MeshId='rbxasset://fonts/head.mesh'
  43. msh.TextureId='rbxassetid://25701026'
  44. end
  45. msh.Scale = Vector3.new(x,y,z)
  46. return msh
  47. end
  48. plr=Game.Players.LocalPlayer
  49. char=plr.Character
  50. for _,v in pairs(char:GetChildren()) do
  51. if v.ClassName=="Part" then
  52. v.Transparency=1
  53. elseif v.ClassName=="Hat" then
  54. v.Handle.Mesh.TextureId='rbxassetid://25701026'
  55. table.insert(Parts,v.Handle)
  56. end
  57. end
  58. t=Part(1,1,1,'',0,false,false,char)
  59. Mesh(t,1,1,1,1)
  60. Weld(char.Torso,t)
  61. a=Part(1,1,1,'',0,false,false,char)
  62. Mesh(a,1,.5,1,1)
  63. Weld(char['Right Arm'],a)
  64. a=Part(1,1,1,'',0,false,false,char)
  65. Mesh(a,1,.5,1,1)
  66. Weld(char['Left Arm'],a)
  67. l=Part(1,1,1,'',0,false,false,char)
  68. Mesh(l,1,.5,1,1)
  69. Weld(char['Right Leg'],l)
  70. l=Part(1,1,1,'',0,false,false,char)
  71. Mesh(l,1,.5,1,1)
  72. Weld(char['Left Leg'],l)
  73. h=Part(1,1,1,'',0,false,false,char)
  74. Mesh(h,2,1,1,1)
  75. Weld(char.Head,h)
  76. Spawn(function()
  77. while(coroutine.yield())do
  78. for i=1,#Parts do
  79. Parts[i].Mesh.VertexColor=GetDiscoColor(tick()*.5)--vertex 4 lyfe
  80. end
  81. end;
  82. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement