Why won't my flashlight script work?

I can’t see any reason of this script shouldn’t work. It’s a localscript and supposed to turn the flashlight on/off when it’s activated. It’s a “tool” in StarterPack.

script.Parent.Activated:Connect(function()
	script.Parent.Light.SpotLight.Enabled = not script.Parent.Light.SpotLight.Enabled
end)

In explorer:

image

Properties of the handle:

Other parts:

local Tool = script.Parent
local Handle = Tool.Handle
local SpotLight = Handle.SpotLight

Tool.Activated:Connect(function()
	SpotLight.Enabled = not SpotLight.Enabled
end)

This works for me.

image

Model file:
repro.rbxm (3.7 KB)

1 Like

My bad, I accidentally enabled the ManualActivationOnly while messing around to fix something else.

But I realized it after checking out your model, so I’m submitting this as an answer. Thanks.