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?
(06-02-2013, 17:37)DidUknowiPwn Wrote: [ -> ]setmodel?
Newb, how it can be 'setmodel' ??
It's MagicBullet, i think..
Oh I read it wrong I thought it said putting the stinger in his fov or something lol
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:
Code:
MagicBullet( "rpg_mp", self geteye(), Bullettrace(self getEye(),self getEye()+anglestoforward(self getplayerangles())*100000,true,self)["position"], self );