"ents.Create = ("rpg_missile")" Explosion damage radius?



function SWEP:throw_attack(range)
         self.Weapon:EmitSound (ShootSound);
         self.BaseClass.ShootEffects (self);
         if (!SERVER) then return end;
         local ent = ents.Create ("rpg_missile");
         ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 40));
         ent:SetAngles (self.Owner:EyeAngles());
		 ent:SetOwner(self.Owner)
         ent:Spawn();
end


Is there any way to set the damage radius of the launched missile?

you can just find all players in the radius of the explosion when it explodes:



for k, v in pairs( ents.FindInSphere(pos_of_explosion, 300) ) do
   if v:IsPlayer() then
      v:TakeDamage(100)
   end
end


or something similar

Where exactly do I put that code in?

It is probably more worth it to script your own entity which behaves similarly, really

Makes sense to a newbe coder, how am I supposed to make one, when I don’t even know the correct codes? I didn’t come here for fun. And you DON’T HAVE TO help me, nobody expect that.