How can i make this if the Character's Torso is close to the door the PointLight turns on and when the Character's Torso is farther than 15 then it turns off. The problem is that it doesn't turn on...
local Door = script.Parent
while true do
for i,v in pairs(game.Players:GetChildren()) do
if (v.Character.Torso.Position - Door.Position).magnitude <= 15 then
Door.PointLight.Enabled = true
if (v.Character.Torso.Position - Door.Position).magnitude <= -15 then
Door.PointLight.Enabled = false
end
end
end
wait()
end
