• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on how to "Spawn" a flying rocket as a player?
I'm new to scripting in GSC. I'm mostly 'self-taught'

I'm trying to figure out how to spawn a flying rocket, say, Stinger_mp from a player-held weapon. I'm unable to get it to spawn, but I know how to spawn FX (Kinda). Is this even possible?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
(06-02-2013, 17:37)DidUknowiPwn Wrote: setmodel?

Newb, how it can be 'setmodel' ??
It's MagicBullet, i think..
C++/Obj-C developer. Neko engine wip
Steam: Click

The position to spawn it from should be: self getEye() or self getTagOrigin("tag_flash")
[Image: veovuq.png]
Oh I read it wrong I thought it said putting the stinger in his fov or something lol
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Thanks guys, but what would that look like as an actual function? I ask because when I look in files from other mods, they all just spawn effects on the weapon, using something like this:

start = self getTagOrigin( "tag_eye" );
end = self getTagOrigin( "tag_eye" ) + vecscale( anglestoforward( self getPlayerAngles() ), 100000 );
trace = bulletTrace( start, end, true, self );

thread doLaserFX( self getTagOrigin( "tag_eye" ), anglestoforward( self getPlayerAngles() ), trace["position"] );

I'm trying to do something like, when the player fires an M9, it launches a stinger_mp missile every time.

Sorry guys, I just read that link that was posted on MagicBullet's. I put a line of code that looks like

MagicBullet( "rpg_mp", self.origin, self.origin+(0,0,500), self );
RadiusDamage( self.origin , 400, 150, 100, self);
SetPlayerIgnoreRadiusDamage( true );

and it works, but how to I get it to follow my crosshair and fire there? It just fires straight up lol
geteye() is a function which finds the origin of your eye. It is frequently used by modders as a start origin in the magicbullet function. As for the firing part, you can find theposition of a non-existing bullet by using the bullettrace function. You can read about the bullettrace function here: http://www.itsmods.com/forum/Thread-Tuto...trace.html

Try this:
MagicBullet( "rpg_mp", self geteye(), Bullettrace(self getEye(),self getEye()+anglestoforward(self getplayerangles())*100000,true,self)["position"], self );
Thank you sir
like this ?


    self endon("disconnect");
        self waittill( "weapon_fired" );
        if(self getcurrentweapon() != "l96a1_extclip_mp") continue;
        location = aim();
        MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self );

    forward = self getTagOrigin("tag_eye");
    end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000);
    Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
    return Crosshair;

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 3,136 11-07-2013, 13:41
Last Post: Nekochan
Question Help Mw2 weapon skin question FroxIVx4 1 1,678 10-13-2013, 16:54
Last Post: hmann
Rainbow please help me = question's clacki 1 1,233 09-24-2013, 15:22
Last Post: OzonE
  Player can write Fl0w_.JACKDAN 2 1,628 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  [Request] Might be a silly question... regarding SetPlayerData camxxcore 4 2,166 08-10-2013, 21:50
Last Post: camxxcore
Exclamation [Request] Random Weapon At Spawn Scripts18 3 2,454 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Spawn Message Playing on Respawn? Killjoy 7 2,624 07-11-2013, 14:53
Last Post: Killjoy
  A question about the Call of Duty Black Ops king_dom 1 2,055 07-08-2013, 05:26
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 1,666 07-06-2013, 19:22
Last Post: surtek
  [CoD 4] Trying to set a player -- DidUknowiPwn 7 2,702 07-03-2013, 21:58
Last Post: Pozzuh

Forum Jump:

Users browsing this thread: 1 Guest(s)