I just started scripting last week and im trying to make a brick thats flashing neon red turn to "Institutional white" and stop flashing after the click detector is clicked.
Here is the click detector script. Its not in the same group as the neon flashing red brick.
local cd = script.Parent local light = game.Workspace.WarningLight local Button = game.Workspace.Button.Buttn cd.MouseHoverEnter:Connect(function() light.Transparency = 0.3 Button.BrickColor = BrickColor.new ("Bright red") end) cd.MouseHoverLeave:Connect(function() light.Transparency = 0 Button.BrickColor = BrickColor.new ("Institutional white") end) cd.MouseClick:Connect(function() light.BrickColor = BrickColor.new ("Institutional white") end)
Here is the flashing red neon brick script
local part = script.Parent while true do wait(2) part.Material = Enum.Material.SmoothPlastic wait(2) part.Material = Enum.Material.Neon end
If you want to disable scripts from within a script you can use script.Disabled = true to disable it and script.Disabled = false to enable it.