function Safe() script.Parent.GreenOn.Value = true script.Parent.Parent.Part1.YellowOn.Value = false script.Parent.Parent.Part2.RedOn.Value = false end script.Parent.ClickDetector.MouseClick:Connect(Safe)
I've Gotten My System To Show A Response, But Not A Correct one
GOAL: Script That Is Activated (Should Repeat Itself Until Set False)
if script.Parent.Parent.Buttons.Part.GreenOn.Value == true then script.Parent.MeshPart.BrickColor = BrickColor.new("Lime green") script.Parent.MeshPart.Material = Enum.Material.Neon script.Parent.MeshPart1.BrickColor = BrickColor.new("Medium stone grey") script.Parent.MeshPart1.Material = Enum.Material.Glass wait(0.25) script.Parent.MeshPart.BrickColor = BrickColor.new("Medium stone grey") script.Parent.MeshPart.Material = Enum.Material.Glass script.Parent.MeshPart1.BrickColor = BrickColor.new("Lime green") script.Parent.MeshPart1.Material = Enum.Material.Neon wait(0.25) end
I think what you would need to do is check whenever the value is changed, then use a while loop to run that piece of code
script.Parent.Parent.Buttons.Part.GreenOn.Changed:Connect(function() while script.Parent.Parent.Buttons.Part.GreenOn.Value == true do script.Parent.MeshPart.BrickColor = BrickColor.new("Lime green") script.Parent.MeshPart.Material = Enum.Material.Neon script.Parent.MeshPart1.BrickColor = BrickColor.new("Medium stone grey") script.Parent.MeshPart1.Material = Enum.Material.Glass wait(0.25) script.Parent.MeshPart.BrickColor = BrickColor.new("Medium stone grey") script.Parent.MeshPart.Material = Enum.Material.Glass script.Parent.MeshPart1.BrickColor = BrickColor.new("Lime green") script.Parent.MeshPart1.Material = Enum.Material.Neon wait(0.25) end end)
If I understand your question correctly this should work
The explaination is not very clear to me, do you want to do this?
local GreenOn=script.Parent.Parent.Buttons.Part.GreenOn local YellowOn=script.Parent.Parent.Buttons.Part1.YellowOn local RedOn=script.Parent.Parent.Buttons.Part2.RedOn local Part0,Part1=script.Parent.MeshPart,script.Parent.MeshPart1 while true do Part0.BrickColor=BrickColor.new("Medium stone grey") Part0.Material=Enum.Material.Glass if GreenOn.Value then Part1.BrickColor=BrickColor.new("Lime green") elseif YellowOn.Value then Part1.BrickColor=BrickColor.new("New Yeller") elseif RedOn.Value then Part1.BrickColor=BrickColor.new("Really red") end Part1.Material=Enum.Material.Neon wait(0.25) Part1.BrickColor=BrickColor.new("Medium stone grey") Part1.Material=Enum.Material.Glass if GreenOn.Value then Part0.BrickColor=BrickColor.new("Lime green") elseif YellowOn.Value then Part0.BrickColor=BrickColor.new("New Yeller") elseif RedOn.Value then Part0.BrickColor=BrickColor.new("Really red") end Part0.Material=Enum.Material.Neon wait(0.25) end