#why wont this work

1 messages · Page 1 of 1 (latest)

main salmon
#
local lit = script.Parent
local lit2 = script.Parent.Parent
local looping = false
local loopThread = nil

-- Function to start flashing
function StartLooping(RequiredColor)
    if looping then return end
    looping = true
    loopThread = coroutine.create(function()
        while looping do
            lit2.Color = RequiredColor
            task.wait(0.1)
            lit2.Color = Color3.fromRGB(0, 0, 0)
            task.wait(0.1)
        end
    end)
    coroutine.resume(loopThread)
end

-- Function to stop flashing
function EndLooping()
    looping = false
    lit2.Color = Color3.fromRGB(0, 0, 0)
end

-- Listen for changes to the BoolValue's Value property
lit:GetPropertyChangedSignal("Value"):Connect(function()
    if lit.Value == true then
        StartLooping(lit.BeepColor.Value)
    else
        EndLooping()
    end
end)

outer wind
#

Errors? Warnings? Have you tried debugging with prints or anythingm

main salmon
#

Dont exist

#

No errors no warnings

#

It just doesnt work

outer wind
#

What type of script is it and where

main salmon
#

Serverscript and in a boolvalue

outer wind
main salmon
#

In a meshpartr

hushed mural
#

Does changing the color of the meshpart in studio change its color

main salmon
#

Yes

hushed mural
#

So your looking to change the book value serverside and see the meshpart change in color

#

Or am I wrong

#

Ig flicker on color is better to say

main salmon
#

When the val of the boolval is changed if its true izn

#

Bruh

#

When the val of the boolval is changed if its true it flickers if not it stops

hushed mural
#

Ye of the value is true

#

Instead of coroutine

#
local boolValue = script.Parent.BoolValue

local function printValue(value)
    print(value)
end

boolValue.Changed:Connect(printValue)

boolValue.Value = true