local object = script.Parent
local position = object.Position
local debounce = false
local waittime = 0.5
script.Parent.MouseButton1Click:Connect(function()
if debounce == false then
debounce = true
if script.Parent.Text == "On" then
script.Parent.Text = "Off"
object:TweenPosition(position,nil,nil,waittime)
script.Parent.BackgroundColor3 = Color3.fromRGB(255,64,67)
else
script.Parent.Text = "On"
object:TweenPosition(UDim2.new(0.714, 0, 0.102, 0),nil,nil,waittime)
script.Parent.BackgroundColor3 = Color3.fromRGB(115,255,120)
end
wait(waittime)
debounce = false
end
end)
i have that script and i want when its on to turn a text to rainbow and when its off to turn it back to white the rainbow script is
function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end
counter = 0
while wait(0.1)do
script.Parent.BackgroundColor3 = Color3.fromHSV(zigzag(counter),1,1)
counter = counter + 0.01
end
and the thing for what i want to turn rainbow is script.Parent.TextButton please respond quick thanks
