Attaching a dynamic light to a model?

Basically what I’m going for is an npc with a flashlight. Parenting a light_dynamic to the npc’s weapon would be terrific, problem is I don’t know if this is possible. I know that you can attatch particle systems to models, anyone know if the same is possible with dynamic lights (I’m not talking about dynamic shadows, by the way)?

I don’t think you can attach props directly to models, even in the QC Script. I have never seen a way to do something like that. I know you can use a few input/output commands in the QC but it’s very limited.

Anyway, it’s very possible to do it using Lua or C++ (gmod/new mod) by modyfing an NPC and attaching some prop to it’s hand. Attachement Bones can also help you doing this.

You could attach a light to the model but it’d have to be a particle system, this would make it limited to only being a visual effect and not actually lighting anything.

This video shows an npc holding a flashlight, is this the sort of thing your wanting?

You could try parenting an env_projected_texture or light_dynamic to the npc in hammer or parenting a light in Garrys mod and setting the alpha of the light model to zero but I don’t think there is a way to actually build it in to the model through QC commands.

Parenting an env_projectedtexture worked out quite nice. I also parented a sprite to represent the light source, but when they crouch it looks a bit weird. However, sprites can be attached to bones, so it’s all good.

I know only that you can attach dynamic light to dynamic model.