What is the issue?
I can’t find a way to make it loop
local hikarivalue = game.Workspace.EmergencyHikari
local hikari = script.Parent.ehikariyo
local function ehikari()
if hikarivalue.Value then
hikari.BrickColor = BrickColor.new("Bright red")
wait(1)
hikari.BrickColor = BrickColor.new("Really black")
wait(1)
else
hikari.BrickColor = BrickColor.new("Really black")
end
end
hikarivalue.Changed:Connect(ehikari)
What solutions have you tried so far?
A somewhat temporary solution I’ve made is duplicate the blink code but I don’t think it’s quite a good solution since if the code ends it needs to be re-clicked again. Not a solution to it but I’ve also tried adding “while true do” that I’ve seen in a dev forum post but it doesn’t seem to work. Any help would be appreciated, thank you!
Two scripts, a part to flash and a bool for a trigger.
Script inside a Really black part
Flasher
local hikarivalue = game.Workspace.EmergencyHikari
local hikari = script.Parent
local function ehikari()
while hikarivalue.Value do
hikari.BrickColor = BrickColor.new("Bright red")
wait(1)
hikari.BrickColor = BrickColor.new("Really black")
wait(1)
end
hikari.BrickColor = BrickColor.new("Really black")
end
hikarivalue.Changed:Connect(ehikari)