local oncd = script.Parent.On.ClickDetector local offcd = script.Parent.Off.ClickDetector local screen = script.Parent.Screen local ison = false if oncd.MouseClick then if ison == false then screen.Color = Color3.new(190, 104, 98) script.Sound:Play() ison = true end end if offcd.MouseClick then if ison == true then screen.Color = Color3.new(0, 0, 0) script.Sound:Pause() ison = false end end
The script is doing absolutely nothing, or it is but it's just super fast to the eye. But I can't point out exactly why it is, it looks perfectly good to me. Especially because there aren't errors.
help me.
thanks for reading and or help,
Narwhal
This is probably happening because the script doesn't loop, try using functions, edited code:
local oncd = script.Parent.On.ClickDetector local offcd = script.Parent.Off.ClickDetector local screen = script.Parent.Screen local ison = false oncd.MouseClick:Connect(function() if ison == false then screen.Color = Color3.new(190, 104, 98) script.Sound:Play() ison = true end end) offcd.MouseClick:Connect(function() if ison == true then screen.Color = Color3.new(0, 0, 0) script.Sound:Pause() ison = false end end)
Also, if this is a GUI then make sure On and Off are text buttons and use the following code:
local on = script.Parent.On local off = script.Parent.Off local screen = script.Parent.Screen local ison = false on.MouseButton1Click:Connect(function() if ison == false then screen.Color = Color3.new(190, 104, 98) script.Sound:Play() ison = true end end) off.MouseButton1Click:Connect(function() if ison == true then screen.Color = Color3.new(0, 0, 0) script.Sound:Pause() ison = false end end)