Resource icon

[VScript] give_tf_weapon v5.1.1

  • Site Migration: See bugs? Report them here. Want something changed or have an idea? Suggest it here.

[VScript] give_tf_weapon v5.1.1

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

This script comes packed with useful functions for player weapons.

Comes with a readme to help you get started.

  • 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
Free to use and modify. Credit is appreciated but not required.
  • 1.png
    2 MB · Views: 596
  • 2.png
    956.4 KB · Views: 556
  • 3.png
    2 MB · Views: 517
  • 4.png
    2.3 MB · Views: 476
  • 5.png
    2 MB · Views: 496
  • 6.png
    940.8 KB · Views: 434
  • 7.png
    2.6 MB · Views: 393
  • 8.png
    2 MB · Views: 387
  • 9.png
    2.5 MB · Views: 385
  • 10.png
    2.1 MB · Views: 407
First release
Last update

More downloads from Yaki

Latest updates

  1. 5.1.0

    Special thanks @Unicake and @SpookyToad for bug reports. Changelog Fixed not being able to hit Engineer buildings if you give "Engy Toolbox" and have a wrench Fixed Demo shields deleting themselves on respawn Updated "Example Half-Life...
  2. v5.0.0

    NOTE BEFORE UPDATING: Both RegisterCustomWeapon() and GiveWeapon() have different parameters, and are incompatible with previous versions. Please update your code so it works with this update! A lot of other functions (like ReturnWeaponTable())...
  3. 4.0.1

    Removed ClearEventCallbacks() from _master.nut Fixed weapons reappearing when switching to other weapons Removed "GTFW_" prefix for functions GTFW_LoadLoadout, GTFW_SaveLoadout, GTFW_DeleteLoadout. Named LoadLoadout(), SaveLoadout()...

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
yeah just make one. Also you don't have to leave a review you can post under Discussion