to close every if statement there needs to be an end statement so the code knows where to stop being 'if'
also more minor but would still be a problem is that if t is local it will only be available within the if statement, so if you want it to be local you have to make the variable before the if
like
local p = Workspace.Player
local t = nil
if p then
t = p.Torso
end
local l = Instance.new("PointLight")
l.parent = t