So I'm making a radio system with "radio stations" in folders. I've made it to detect that a radio station is in game. The code is
local Frequency = script.Parent.Parent.Frequency
local Station1 = game.Workspace.RadioStations:FindFirstChild("Test1")
local Station2 = game.Workspace.RadioStations:FindFirstChild("Test2")
function onClicked()
if Frequency.Value == 1 then
if Station1 then
script.Parent.Parent.MessageScreen.SurfaceGui.SuccessMessage.Visible = true
elseif Frequency.Value == 2 then
elseif Station2 then
script.Parent.Parent.MessageScreen.SurfaceGui.SuccessMessage.Visible = true
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
The SurfaceGUI for Frequency 1 works, but if I set frequency to 2 and press the button, it doesn't show up the message. Please help me.

1 comment
Thank you! You've fixed my script!