local Radio = script.Parent
local ClickDetectorRadio = script.Parent.Part.ClickDetector
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Songs = {ReplicatedStorage.Assets.ChillJazz}
local RadioEnabled = false
local function RadioToggle()
print("a")
if not RadioEnabled then
RadioEnabled = true
print("playing")
local Song = Songs[1]:Clone()
Song.Parent = Radio ; Song:Play()
return
end
RadioEnabled = false;
local IsSong = Radio:FindFirstChildWhichIsA("Sound");
if IsSong then IsSong:Destroy() end;
end
print("a1")
ClickDetectorRadio.MouseClick:Connect(RadioToggle)
the last print “a1” is printing so the script is running but the fgunction isnt being fired
What that script does, is it binds an action to left mouse button. This may be interfering with the clickdetector, because you unbind the clickdetector