ok so i set up this function that should spawn a prop with the model according to the table props that i set up further on, but when the prop spawns it spawns right above me like in my head and it doesn’t collide with me or the physics gun. i know it has something to do with the setpos though.
[lua]
function spawnprop( ply, props )
local ent=ents.Create(“prop_physics”)
ent:SetModel( props )
ent:SetPos( ply:GetShootPos() )
ent:SetOwner( ply )
ent:Spawn()
ent:EmitSound(“npc/scanner/combat_scan5.wav”)
end
[/lua]
and later on i do a if then thing where it will run this function with props[1] defined in a table.
i put the whole script in garrysmod/garrysmod/lua/autorun
How can i make it solid to me and physics gun and spawn it at my crosshair?