You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I have this UI that you can click on the signal, and it appears, and you can change the color of that one signal. However, I want it so you can click on ANY signal, and this UI appears and you can change the color of it.
What is the issue?
Not really sure how to do it using my current code.
What solutions have you tried so far?
I asked two of my fellow scripters, 1 of them is unavailable, and the other one can’t help as he isn’t sure.
local SignallingBackPanel = script.Parent.Parent
local Signal = SignallingBackPanel.Signal1
local Frame = script.Parent
local GreenButton = Frame.Green
local YellowButton = Frame.Yellow
local RedButton = Frame.Red
Frame.Green.MouseButton1Click:Connect(function()
SignallingBackPanel.Signal1.BackgroundColor3 = Color3.fromRGB(68, 255, 0)
end)
Frame.Yellow.MouseButton1Click:Connect(function()
SignallingBackPanel.Signal1.BackgroundColor3 = Color3.fromRGB(255, 229, 35)
end)
Frame.Red.MouseButton1Click:Connect(function()
SignallingBackPanel.Signal1.BackgroundColor3 = Color3.fromRGB(255, 26, 26)
end)
You could try connecting a function whenever the signal UI is clicked and it’d open up the color UI, then you could connect each one of the buttons to change the color of the signal.
Here’s an example:
...
colorUI.Red.MouseButton1Click:Connect(function()
-- color it red
end)
colorUI.Yellow.MouseButton1Click:Connect(function()
-- color it yellow
end)
colorUI.Green.MouseButton1Click:Connect(function()
-- color it green
end)
signal.MouseButton1Click:Connect(function()
colorUI.Visible = true
end)
If there are multiple signals, then you could have a global variable that could be used in the color changing signals
...
local currentSignal = nil
colorUI.Red.MouseButton1Click:Connect(function()
currentSignal.BackgroundColor3 = Color3.fromRGB(...) -- red
end)
colorUI.Yellow.MouseButton1Click:Connect(function()
currentSignal.BackgroundColor3 = Color3.fromRGB(...) -- yellow
end)
colorUI.Green.MouseButton1Click:Connect(function()
currentSignal.BackgroundColor3 = Color3.fromRGB(...) -- green
end)
signal.MouseButton1Click:Connect(function()
currentSignal = signal
colorUI.Visible = true
end)