Swep/Entity question

Just one question this time guys,

How would I make a swep spawn an entity in midair in the way your are facing but always at the same height above the ground so it doesn’t use the up down of the weapon to any use?

Something like

local dir = pl:GetAimVector();
dir.z = 0;
local pos = pl:GetPos() + ( dir * 200 );

How would i get an entity to spawn in that direction a few feet in front?




Little error:

[lua] local dir = pl:GetAimVector();[/lua]
what should pl be? i tried ply but that didn’t work…