• Fire rocket command
    2 replies, posted
Basically, I've been trying and trying to get a working rocket to fire just like the rocket launcher launches them, except through a command. I've tried playing with rpg_missile (the entity) but it appears to not work quite right(if you create it, it drops to the ground and explodes, or else fires off in a random direction). I know lua, but I can't figure out what input would need to be applied to the entity to get it to follow a rocket launcher or activate. This is the same thing that Gmod tower has, basically.
[lua] concommand.Add("soiherduliekrpgs",function(a,b,c) local r = ents.Create("rpg_missile") r:SetPos(a:GetShootPos() + a:GetForward() * 72 ) r:SetAngles( a:GetAimVector():Normalize():Angle() ) r:SetOwner( a ) r:Spawn() r:SetVelocity( r:GetForward() * 9001 ) ) [/lua]
Thanks, didn't know applying velocity would be all the thing you needed!
Sorry, you need to Log In to post a reply to this thread.