Advertisement
HenloMyDude

rainbow

Aug 16th, 2019
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. plr = owner
  2. char = plr.Character
  3.  
  4. local ArtificialHB = Instance.new("BindableEvent", script)
  5. ArtificialHB.Name = "Heartbeat"
  6.  
  7. script:WaitForChild("Heartbeat")
  8.  
  9. local tf = 0
  10. local allowframeloss = false
  11. local tossremainder = false
  12. local lastframe = tick()
  13. local frame = 1/60
  14. ArtificialHB:Fire()
  15.  
  16. game:GetService("RunService").Heartbeat:connect(function(s, p)
  17. tf = tf + s
  18. if tf >= frame then
  19. if allowframeloss then
  20. script.Heartbeat:Fire()
  21. lastframe = tick()
  22. else
  23. for i = 1, math.floor(tf / frame) do
  24. ArtificialHB:Fire()
  25. end
  26. lastframe = tick()
  27. end
  28. if tossremainder then
  29. tf = 0
  30. else
  31. tf = tf - frame * math.floor(tf / frame)
  32. end
  33. end
  34. end)
  35.  
  36. function swait(num)
  37. if num == 0 or num == nil then
  38. ArtificialHB.Event:wait()
  39. else
  40. for i = 0, num do
  41. ArtificialHB.Event:wait()
  42. end
  43. end
  44. end
  45. -------- RAINBOW LEAVE IT TO ME
  46. local r = 255
  47. local g = 0
  48. local b = 0
  49. coroutine.resume(coroutine.create(function()
  50. while wait() do
  51. for i = 0, 254/5 do
  52. swait()
  53. g = g + 5
  54. end
  55. for i = 0, 254/5 do
  56. swait()
  57. r = r - 5
  58. end
  59. for i = 0, 254/5 do
  60. swait()
  61. b = b + 5
  62. end
  63. for i = 0, 254/5 do
  64. swait()
  65. g = g - 5
  66. end
  67. for i = 0, 254/5 do
  68. swait()
  69. r = r + 5
  70. end
  71. for i = 0, 254/5 do
  72. swait()
  73. b = b - 5
  74. end
  75. end
  76. end))
  77.  
  78. while wait() do
  79. for _,v in pairs (owner.Character:GetDescendants()) do
  80. if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
  81. v.Material = "ForceField"
  82. v.Color = Color3.new(r/255, g/255, b/255)
  83. if v:IsA("UnionOperation") then
  84. v.UsePartColor = true
  85. end
  86. end
  87. if v:IsA("Accessory") or v:IsA("Hat") then
  88. for _,v in pairs (v:GetDescendants()) do
  89. if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
  90. v.Material = "ForceField"
  91. v.Color = Color3.new(r/255, g/255, b/255)
  92. for _,v in pairs (v:children()) do
  93. if v:IsA("Part") then
  94. v.Material = "ForceField"
  95. v.Color = Color3.new(r/255, g/255, b/255)
  96. end
  97. if v:IsA("UnionOperation") then
  98. v.UsePartColor = true
  99. end
  100. end
  101. end
  102. if v:IsA("MeshPart") then
  103. v.Material = "ForceField"
  104. v.Color = Color3.new(r/255, g/255, b/255)
  105. end
  106. if v:IsA("Tool") then
  107. for _,v in pairs (v:GetDescendants()) do
  108. if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
  109. v.Material = "ForceField"
  110. v.Color = Color3.new(r/255, g/255, b/255)
  111. if v:IsA("UnionOperation") then
  112. v.UsePartColor = true
  113. end
  114. end
  115. end
  116. end
  117. if v:IsA("Model") then
  118. for _,v in pairs (v:GetDescendants()) do
  119. if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
  120. v.Material = "ForceField"
  121. v.Color = Color3.new(r/255, g/255, b/255)
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end
  128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement