Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How make a flashlight blink every 2second?

I try this but dont work.

function blink()
	while true do
		game.StarterPack.Flashlight.LightPart.SpotLight2.Brightness = 0
		game.StarterPack.Flashlight.LightPart.SpotLight.Brightness = 0
		wait(2)
		game.StarterPack.Flashlight.LightPart.SpotLight.Brightness = 0.5
	 	game.StarterPack.Flashlight.LightPart.SpotLight2.Brightness = 0.5
		wait(2)
	end
end
script.Parent.Touched:Connect(blink)

1 answer

✓ Accepted answer

This is actually from an old script I had for a flickering flashlight. Also, the reason it doesn't work is because thats the flashlight in the starterpack, not the player's backpack.

-- put this in the flashlight's tool

local flicker = 2

local light = script.Parent:WaitForChild("LightPart")
local s1,s2 = light:WaitForChild("Spotlight"),light:WaitForChild("Spotlight2")

while true do
	for i = 1,2 do
		s1.Enabled = not s1.Enabled
		s2.Enabled = not s2.Enabled
		wait(2)
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.