Is there a way to include an event, such as .Changed and connect it to a function. This is what I have so far, why doesn't it work?
local function Light() while script.Parent.Parent.Parent.Danger.Value==true do for i=0,180,1 do script.Parent.Orientation = Vector3.new(0,i,0) wait(0.01) end end end script.Parent.Parent.Parent.Danger.Changed:connect(Light())
Super close. You don't don't put the extra ().
script.Parent.Parent.Parent.Danger.Changed:Connect(Light)