Author Topic: tumble a player/launch player  (Read 869 times)

How would one tumble another player with a projectile?

On top of that, how do you cause the player firing the weapon to be launched in the direction they are looking?

How would one tumble another player with a projectile?
Package myProjectile::onCollision. You can use search to find the arguments. Use the tumble function in the skis add-ons on the player hit by the projectile. Don't forget to make sure that it's a player that they hit and that miniGameCanDamage(%playerA, %playerB); returns true.

Launched in the direction they are looking?

Well, in YourWeapon::onFire(%this, %obj, %slot) you're going to want to add in a change of velocity to the player. To get the direction they're pointing the gun, you get the player's muzzleVector with getMuzzleVector( slot ). So, something like this would launch your player in the direction the weapon in slot 0 (primary equipped) is pointed: %obj.addVelocity(%obj.getMuzzleVector(0));

However, you may want to scale that up by some factor with vectorScale( vector, # ). I'd recommend playing around with five or so for a good push, more than that will be a solid slingshot and less than that will be a nudge.
« Last Edit: July 25, 2015, 08:16:49 PM by $trinick »

Another question, I meant to say how do I tumble someone when a player hits them with their own body?

I'm trying to tumble a player by slamming the person using the weapon into another player.

Run a trace, and walk into a bot or another player.