Resource icon

[VScript] give_tf_weapon GTFW is now Retired

  • Hey you! Yes, you! Add images to your downloads, it's free! Use the orange "Manage Download Image" button in the top right.

[VScript] give_tf_weapon GTFW is now Retired

Made to make giving weapons, easy! Also supports custom weapons!

3/11/24 This script is now retired and obsolete. You can pull code from this script but please make your own.​



This script comes packed with useful functions for player weapons.

Comes with a readme to help you get started.

Features:
  • Function GiveWeapon() lets any TFclass equip any weapon in the game.
    • Weapons are not guaranteed to work, however. But they do spawn.
  • Weapons used by unintended classes have their arms match that class being played.
  • Function GetWeapon() can get the handle of a player's weapon.
    • Can find even passive items in slots.
  • Functions to delete, save, load any vscript-made or non-vscript made weapons.
  • Sorts every weapon in TF2 to a VScript "database". Essentially, it lists things like weapon name (i.e."Brass Beast"), the classname, the item definition index, even max reserve ammo, ammo type, what class uses the weapon, what slot they are in. And more.
    • Use function handle_player.GetWeaponTable( weapon ), or alternatively GetWeaponTableNoPlayer( weapon )
  • Supports making custom weapons. These weapons can be registered into the database using the function RegisterCustomWeapon(). Use GiveWeapon() to retrieve the weapon.

Comes with various tutorials and resources to help you get started.

Please place all files in the /tf/scripts/vscripts/ directory, and then execute give_tf_weapon/_master.nut

Special thanks ficool2 for finding the netprops to make the first weapon giving function, AddWeapon().
Special thanks @Mr. Burguers for being a wealth of knowledge, teaching me how to use vscript.
Special thanks devs of Super Zombie Fortress + SCP Secret Fortress for releasing their source code (taught me what netprops were needed for custom viewmodels).
Special thanks @LizardOfOz for feedback
License
Free to use and modify. Credit is appreciated but not required.
  • 1.png
    1.png
    2 MB · Views: 935
  • 2.png
    2.png
    956.4 KB · Views: 871
  • 3.png
    3.png
    2 MB · Views: 814
  • 4.png
    4.png
    2.3 MB · Views: 756
  • 5.png
    5.png
    2 MB · Views: 771
  • 6.png
    6.png
    940.8 KB · Views: 718
  • 7.png
    7.png
    2.6 MB · Views: 673
  • 8.png
    8.png
    2 MB · Views: 666
  • 9.png
    9.png
    2.5 MB · Views: 655
  • 10.png
    10.png
    2.1 MB · Views: 713
Author
Yaki
Downloads
4,028
Views
10,589
First release
Last update
Category
VScript

More downloads from Yaki

Latest updates

  1. retirement of GTFW

    Hey everybody, Thank you for taking the time to read this. I believe the time is right to say: I am now retiring GTFW. TF2's VScript has had enough time to develop. I believe the TF2 Community now have enough experience to be able to make their...
  2. 5.4.0 Major Update

    EDIT: Hey VScripter, I kinda messed this update up and it is kinda broken. I'm sorry. Right as I uploaded I found bugs, sooo. Yeah. Original Post This update is pretty important. It makes use of A LOT of Squirrel techniques I've learned since I...
  3. 5.3.0

    Fixed custom weapon viewmodels from not playing animations This was due to an netprop model override "m_nModelIndexOverrides" being set for custom third person model. While it fixes crit glows, it also breaks viewmodel animations. Good to know...

Latest reviews

My autistic brain can't figure how to work this
very good mod! had a lot of fun with it
Awesome script, thanks guys.
hey so in my scripts foldier i do not have a vscripts foldier can i just make one
Yaki
Yaki
yeah just make one. Also you don't have to leave a review you can post under Discussion