There are the proper variables in place btw
Anyways, this script is supposed to make a block strobe and stuff, but I can't get it to stop. I try to break the loop but it does nothing and keep strobing. What am I missing here?
function strobe() s:Play() local parts = a:GetChildren() for i,v in pairs(parts) do if v.name == "Strobe" then spawn(function(f) while true do --Setting up a loop to cycle through v.Material = "Neon" v.PointLight.Brightness = v.PointLight.Brightness == 0 and 5 or 0; wait(0.03) if t.Screen.SurfaceGui.MainFrame.GrayThing.ImageLabel.ImageButtonOff.MouseButton1Down == true then break end end end) end end end t.Screen.SurfaceGui.MainFrame.GrayThing.ImageLabel.ImageButtonOn.MouseButton1Down:Connect(function() strobe() end) c.MouseClick:Connect(function(clicker) --Linking a function to the click of the handle strobe() end)
Thanks!
--You can stop while true do making a variable true and changing to false local loop = true --Example using click script.Parent.MouseButton1Click:connect(function() loop = false end) while loop do wait() print("Hello") end