-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrainbow-killparts.lua
More file actions
166 lines (147 loc) · 5.16 KB
/
rainbow-killparts.lua
File metadata and controls
166 lines (147 loc) · 5.16 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local CollectionService = game:GetService("CollectionService")
local LocalPlayer = Players.LocalPlayer
local hue = 0
local rainbowEnabled = false
local folded = false
local TITLE_H = 24
local SPEED_H = 22
local BRIGHT_H = 22
local TOGGLE_H = 22
local CREDIT_H = 18
local totalHeight = TITLE_H + SPEED_H + BRIGHT_H + TOGGLE_H + CREDIT_H
local gui = Instance.new("ScreenGui")
gui.Name = "7hvHtD4s"
gui.ResetOnSpawn = false
gui.Parent = LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 240, 0, totalHeight)
mainFrame.Position = UDim2.new(0.5, -120, 0.3, 0)
mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Draggable = true
mainFrame.ClipsDescendants = true
mainFrame.Parent = gui
Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 8)
local title = Instance.new("TextLabel")
title.Text = "TOH Rainbow kill parts"
title.Size = UDim2.new(1, -64, 0, TITLE_H)
title.Position = UDim2.new(0, 8, 0, 0)
title.TextColor3 = Color3.new(1, 1, 1)
title.BackgroundTransparency = 1
title.Font = Enum.Font.GothamBold
title.TextSize = 16
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = mainFrame
local foldBtn = Instance.new("TextButton")
foldBtn.Text = "-"
foldBtn.Size = UDim2.new(0, 24, 0, TITLE_H)
foldBtn.Position = UDim2.new(1, -56, 0, 0)
foldBtn.TextColor3 = Color3.new(1, 1, 1)
foldBtn.BackgroundTransparency = 1
foldBtn.Font = Enum.Font.GothamBold
foldBtn.TextSize = 18
foldBtn.Parent = mainFrame
local closeBtn = Instance.new("TextButton")
closeBtn.Text = "X"
closeBtn.Size = UDim2.new(0, 24, 0, TITLE_H)
closeBtn.Position = UDim2.new(1, -28, 0, 0)
closeBtn.TextColor3 = Color3.new(1, 1, 1)
closeBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextSize = 18
closeBtn.Parent = mainFrame
Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 4)
local speedBox = Instance.new("TextBox")
speedBox.PlaceholderText = "Speed (default 0.08)"
speedBox.Text = "0.08"
speedBox.Size = UDim2.new(1, -16, 0, SPEED_H)
speedBox.Position = UDim2.new(0, 8, 0, TITLE_H)
speedBox.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
speedBox.TextColor3 = Color3.new(1, 1, 1)
speedBox.Font = Enum.Font.Gotham
speedBox.TextSize = 14
speedBox.ClearTextOnFocus = false
speedBox.Parent = mainFrame
Instance.new("UICorner", speedBox).CornerRadius = UDim.new(0, 4)
local brightnessBox = Instance.new("TextBox")
brightnessBox.PlaceholderText = "Brightness (default 1)"
brightnessBox.Text = "1"
brightnessBox.Size = UDim2.new(1, -16, 0, BRIGHT_H)
brightnessBox.Position = UDim2.new(0, 8, 0, TITLE_H + SPEED_H)
brightnessBox.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
brightnessBox.TextColor3 = Color3.new(1, 1, 1)
brightnessBox.Font = Enum.Font.Gotham
brightnessBox.TextSize = 14
brightnessBox.ClearTextOnFocus = false
brightnessBox.Parent = mainFrame
Instance.new("UICorner", brightnessBox).CornerRadius = UDim.new(0, 4)
local toggleBtn = Instance.new("TextButton")
toggleBtn.Text = "Enable Rainbow"
toggleBtn.Size = UDim2.new(1, -16, 0, TOGGLE_H)
toggleBtn.Position = UDim2.new(0, 8, 0, TITLE_H + SPEED_H + BRIGHT_H)
toggleBtn.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
toggleBtn.TextColor3 = Color3.new(1, 1, 1)
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.TextSize = 14
toggleBtn.Parent = mainFrame
Instance.new("UICorner", toggleBtn).CornerRadius = UDim.new(0, 4)
local credit = Instance.new("TextLabel")
credit.Text = "Made by 3dsj2"
credit.Size = UDim2.new(1, -16, 0, CREDIT_H)
credit.Position = UDim2.new(0, 8, 0, TITLE_H + SPEED_H + BRIGHT_H + TOGGLE_H)
credit.TextColor3 = Color3.fromRGB(160, 160, 160)
credit.BackgroundTransparency = 1
credit.Font = Enum.Font.Gotham
credit.TextSize = 12
credit.TextXAlignment = Enum.TextXAlignment.Left
credit.Parent = mainFrame
local speedValue = 0.08
local brightnessValue = 1
local rainbowActive = false
toggleBtn.MouseButton1Click:Connect(function()
rainbowActive = not rainbowActive
toggleBtn.Text = rainbowActive and "Disable Rainbow" or "Enable Rainbow"
end)
speedBox.FocusLost:Connect(function()
local val = tonumber(speedBox.Text)
if val then
speedValue = val
end
end)
brightnessBox.FocusLost:Connect(function()
local val = tonumber(brightnessBox.Text)
if val then
brightnessValue = val
end
end)
closeBtn.MouseButton1Click:Connect(function()
rainbowActive = false
gui:Destroy()
end)
foldBtn.MouseButton1Click:Connect(function()
folded = not folded
if folded then
mainFrame:TweenSize(UDim2.new(0, 240, 0, TITLE_H), "Out", "Quart", 0.25, true)
foldBtn.Text = "+"
else
mainFrame:TweenSize(UDim2.new(0, 240, 0, totalHeight), "Out", "Quart", 0.25, true)
foldBtn.Text = "-"
end
speedBox.Visible = not folded
brightnessBox.Visible = not folded
toggleBtn.Visible = not folded
credit.Visible = not folded
end)
RunService.RenderStepped:Connect(function(dt)
if not rainbowActive then return end
hue = (hue + dt * speedValue) % 1
local color = Color3.fromHSV(hue, 1, brightnessValue)
for _, part in pairs(CollectionService:GetTagged("KillBrick")) do
if part:IsA("BasePart") then
part.Color = color
end
end
end)