-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrainbow.lua
More file actions
42 lines (37 loc) · 1015 Bytes
/
rainbow.lua
File metadata and controls
42 lines (37 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
task.wait(3)
local RunService = game:GetService("RunService")
local tweenService = game:GetService("TweenService")
local rainbowParts = {}
for _, part in script.Parent:GetDescendants() do
if part:GetAttribute("Rainbow") then
table.insert(rainbowParts, part)
end
end
local colors = {
Color3.fromRGB(253, 0, 0),
Color3.fromRGB(255, 165, 0),
Color3.fromRGB(255, 255, 0),
Color3.fromRGB(0, 255, 0),
Color3.fromRGB(0, 255, 255),
Color3.fromRGB(0, 100, 255),
Color3.fromRGB(191, 64, 191),
Color3.fromRGB(255, 0, 255)
}
local changeTime = 5
local info = TweenInfo.new(changeTime, Enum.EasingStyle.Linear)
local i = 1
local db = false
RunService.Heartbeat:Connect(function()
if not db then
db = true
for _, part in rainbowParts do
tweenService:Create(part, info, {Color = colors[i]}):Play()
end
i += 1
if i > #colors then
i = 1
end
task.wait(changeTime)
db = false
end
end)