Need Help with creating projectiles!

Discussion in 'Plugin Development' started by ReyRey541, Apr 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ReyRey541

    Hi guys I'm currently working on a "Team Fortress 2" server but I'm having some trouble with getting the guns to fire projectiles. Based off the texture pack here is what I am planning to do

    Lever = Pistol (Will be Semi-automatic but will fire an arrow)
    Flint and Steel = Flare Gun (Will be semi-automatic with a 2 second cool-down, will fire a Fire Charge)

    Arrow = Bullet (I need to be able to change how much damage this does per weapon)
    Brewing Stand = Rocket Launcher (Will fire a primed tnt, is there anyway to make sure the tnt does not do map damage?)

    Carrot on a Stick = Sniper Rifle (Will be an instant kill, I also am working on a zoom effect.)
    I know it's alot but i'm a noob to Java programming.

    ~Thanks in Advance!~
     
  2. Offline

    Iroh

    Moved to plugin dev.
     
  3. Offline

    Epixpenguin

    Could we have some code to help? We can't do much without it.
     
  4. use cooldowns, and PlayerInteractEvent
    Check what the player has in his hand, if it matches the item then use
    e.getPlayer().throwSnowball(); or e.getPlayer().throwEgg();
    [EDIT]: Rename the egg to something like Bullet1 and on a playerdamageevent or whatever the event is called, check what they were hit by. If it was the bullet set a custom damage amount/set the Vector for the players movement to push them back if the bullet is 'powerful'. You can also use Vectors to push the player who fired it for Recoil.
     
Thread Status:
Not open for further replies.

Share This Page