codemen

Rainbow man script [roblox]

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