[VSCRIPT] main_thing's Fun Commands (MTFC)

main_thing

L1: Registered
Jan 7, 2023
13
9
This is my first post here. Please inform me if I'm doing anything wrong. (I have read the rules).

[VSCRIPT] main_thing's Fun Commands (MTFC) version 1.0
previously known as [VSCRIPT] Chat Commands version 1.0

This is the official release [VSCRIPT] main_thing's Fun Commands (MTFC) version 1.0! It include many fun features to play around with, online and offline!
(Yes, these do in fact work on both).

Features:

  • Fixes Mann vs. Machine chat between red and blue team.
  • Custom Weapons API (So you can make any weapon you can imagine!)
  • Chat Commands! (not in any particular order)
  • Steam Id logging (for servers).
    • !joinblue (puts you in the blue team in MVM)
    • !hhh (become the headless horseless horseman!)
    • !giveweapon (!giveweapon tf_weapon_minigun 850 this gives you a deflector)
    • !giveweaponcustom (gives you a custom weapon defined in the custom weapon file. Example: !giveweaponcustom x1000 sniper rifle)
    • !tank (become the MVM tank!)
    • !noclip (toggles noclip on the player)
    • !tp / !fp (forces player into thirdperson and firstperson respectively)
    • !taunt (allows the player to perform any taunt. Example: !taunt 1118)(Conga).
    • !dropweapon (drops the active weapon. Does not copy custom attributes).
    • !setclass (changes class on the spot! Example: !setclass medic).
    • !meem (turns you into a cardboard cutout of yourself!).
    • !nohats (removes all your hats).
    • !noweapons (removes all your weapons).
    • !noloadout (removes both hats and weapons).
    • !powerplay (grants you power play!).
    • !buffweapon (makes your active weapon have the stats of the valve rocket launcher).
    • !kill (kills you).
    • !deploybomb (deploys the bomb in MVM. Does nothing most of the time).
    • !bonk (stuns you for 10 seconds).
    • !giant (makes you have the stats of a MVM giant. Player model does not change).
    • !deflector (become the giant deflector heavy).
    • !sergeantcrits (become sergeant crits).
    • !samuraidemo (become samurai demo).
    • !sirnuke (become Sir Nukesalot).
    • !superscout (become a super scout).
    • !tauntlist (prints all available taunts into the console for use with the !taunt command).
    • !afk (makes you invincible and unable to be moved or interacted with. You will not be auto-kicked in this state).
    • !customweaponlist (prints all custom weapons defined in the custom weapons file).
    • !help (prints all commands in chat).
    • !disablekick (disables being auto-kicked. does nothing on listen servers).
    • !toolgun (adds a toolgun to your inventory)
    • !steamid (returns your steamid in steamid3)

Installation:

  1. open steam.
  2. navigate to library.
  3. open Team Fortress 2 page. (I don't know what it's called).
  4. click on the gear icon.
  5. click on properties.
  6. click on local files.
  7. click on browse.
  8. open the "tf" folder.
  9. extract chatcommands.zip into the "tf" folder.
  10. open Team Fortress 2.
  11. play any Team Fortress 2 map locally.
  12. Enjoy using the chat commands.

Creating Custom Weapons:

  1. open steam.
  2. navigate to library.
  3. open Team Fortress 2 page.
  4. click on the gear icon.
  5. click on properties.
  6. click on local files.
  7. click on browse.
  8. open the "tf" folder.
  9. open the "scriptdata" folder.
  10. open cweapons.txt
  11. Format for making custom weapons.​

  • Here is a template for making custom weapons.
deflector{
"classname" "tf_weapon_minigun"
"itemindex" 850
"attributes" ("damage bonus",1.5;"attack projectiles",1)
}
  • The first line of the custom weapon format contains the name for the weapon when being selected with the !giveweaponcustom chat command.
  • Note: The weapon name must be in lowercase. There should not be a space between the "*" and the "{"
  • The second line defines the weapon's entity type. These are what the game spawns as the weapon. All of these should start with "tf_weapon". Here's a list of the available weapon entities: https://cfg.tf/tools/crosshairs/names/.
  • Note: tf_weapon_builder, tf_weapon_sapper and tf_weapon_invis are not supported.
  • The third line contains the weapon item definition index. They can be found in 2 places, items_game.txt and here: https://wiki.alliedmods.net/Team_fortress_2_item_definition_indexes. This line defines the weapon's name and how it shows up in game.
  • The fourth line contains all of your custom weapon attributes. It must be enclosed in brackets. Each attribute is added in the format ("attributename",5;"attributename",2)
  • Note: do not add ";" at the end of the line. Do not forget to have "," in between the attribute name and its value. If you don't want to add any custom attributes, write "attributes" () for that line.
  • The last line ends the configuration for that specific weapon.

Have fun!

 

Attachments

  • chatcommands.zip
    11.4 KB · Views: 167
  • chatcommands-1.1.zip
    13.8 KB · Views: 105
  • chatcommands-1.2.zip
    25.2 KB · Views: 125
  • chatcommands-1.2b.zip
    25.3 KB · Views: 108
  • chatcommands-1.3.zip
    26.6 KB · Views: 106
  • chatcommands-1.3b.zip
    26.6 KB · Views: 250
  • chatcommands-1.4.zip
    31 KB · Views: 4
Last edited:

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
The name 'Chat Commands' leads one to think this is a set of commands for modifying chat. In fact it's a grab bag of various fun commands. I suggest you come up with a less generic name.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
I'm surprised you changed it so quickly. It's always nice when people take advice.

Command Grab Bag sounds more interesting but I think the term may not be understood by non-native English speakers, or perhaps non-UK citizens. Since this seems very similar to SourceMod's funcommands.smx, I humbly suggest you call it something like Main Thing's Fun Commands (MTCF). To anyone who reads the name, it's immediately obvious what it's for, and it's a unique name.

Also, I wonder if the MvM chat fix and weapon-giving systems might be better as separate libraries? You could make them dependencies in your fun commands script(s). People could then use those systems in their own work without having to worry about unbundling them from the fun commands. Just a thought, though.

Nice work!
 

main_thing

L1: Registered
Jan 7, 2023
13
9
I might work on the making them into separate dependencies tomorrow. I completely agree with the renaming too.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
You're a rare treasure.
 

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.1

  • added the !robot command
  • fixed !meem command to make it toggle-able
  • have split the Mann vs. Machine chat fix and weapon giving functions into separate scripts for easier maintaining. (feel free to use it in your own projects)
  • added a spoofchat() function internally in the Mann vs. Machine chat fix file. (does not require mvm to be running).
    • spoofchat(3,"scouty boi","hello!") - will make a scouty boi say hello in chat (does not need a player named scouty boi in game).
    • (Removed per request)
  • added giveweaponcustom() function internally in weaponfunctions.nut.
    • giveweaponcustom(Entities.FindByName(null,"player24"),"batsaber") will give a weapon named "batsaber" to a player with the targetname of "player24".
Please report any bugs to me. I want to improve this script for all to use :).

Have Fun!

 

Attachments

  • chatcommands-1.1.zip
    13.7 KB · Views: 72
Last edited:

Zeus

Not a Krusty Krab
aa
Oct 15, 2014
1,344
553
We're totally okay having people share this kinda stuff and people are free to make maps using it; but please be cognisant that if any of these things lead to circumventing our admin controls or bullying / abuse, we will delete the map and the author will be permanently banned.

Impersonating another user (especially an admin) through chat is strictly prohibited on our servers. (so be very very careful using this spoofchat function)

We don't want to restrict peoples creativity with vscript; but we also need to maintain control of our own servers / playtests.
Hope that makes sense.
 

main_thing

L1: Registered
Jan 7, 2023
13
9
I did not know that, and intended to cause no harm with it. I had in mind for using it for horror-esque maps, like with teamnum 0 of spoof chat that will use a black name with *DEAD* appended to the start it. The spoof chat function does not execute chat commands on behalf of players. The function is not for impersonation. I will promptly remove it as I dont want to be the cause of cool maps being removed.
 
Last edited:

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.1b
  • fixed bug that prevented the mvm chat dependency from functioning. This has been fixed.
    • Extra details: I forgot to parse the script in a while(){}. Instead, just had a while() loop parsing nothing.
 

Attachments

  • chatcommands-1.1b.zip
    13.7 KB · Views: 79

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.2
  • Added the !addattribute command.
  • Added !randomweapon
    • Gives the player any weapon in the game randomly.
    • Note: this excludes sappers, sheilds, sniper razorback type weapons and invis watches.
  • Added !randomloadout
    • randomises the players loadout. If a wrench is received you will receive the pdas.
 

Attachments

  • chatcommands-1.2.zip
    25.2 KB · Views: 94

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.2b
  • Updated MVM Chat fix.
    • It now displays spectator in chat in MVM.
  • Updated !randomloadout to not crash users to desktop apon receiving the PDAs
 

Attachments

  • chatcommands-1.2b.zip
    25.3 KB · Views: 69

InsanePyroFest

L1: Registered
Apr 17, 2023
1
1
Hello i hope its okay if i make a suggestion if this is being updated anymore but can there be a allow admins to use the commands? or atleast something like that?
 

main_thing

L1: Registered
Jan 7, 2023
13
9
I am planning to add a admins config. With a steam id system. Its still in the works and it'll take a while to do.
 

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.3
  • Added a admins manager for the script.
    • To enable / disable this functionality replace "adminsenabled = 1" at the start of the text file in scriptdata/admins.txt with "adminsenabled = 0".
    • To add admins, paste the steamid3 of the user into the file. Make sure every new admin is in a newline so the script will function properly.
    • The script announces if the admin joins aswell.
  • Made !randomloadout give the disguise kit for Spies. This does clash with the construction PDA so it might be removed in a future update.
 

Attachments

  • chatcommands-1.3.zip
    26.6 KB · Views: 45

Rigged Buster

L1: Registered
May 3, 2023
2
0
Not working for me somehow. I have vscript enabled in betas, I have -dev in startup, and it is extracted correctly. I checked both the scripts and scripts data in the tf folder and they all have their correct files.

When I load in a map, it says this in the chat:
[VSCRIPT] Type !help to see a list of commands
When I type any commands, it doesn't do anything. I also tried turning sv_cheats on.
 

main_thing

L1: Registered
Jan 7, 2023
13
9
Updated [VSCRIPT] main_thing's Fun Commands (MTFC) to 1.3b
  • Disabled admins feature from being enabled by default. (This should solve the chat commands not working)
 

Attachments

  • chatcommands-1.3b.zip
    26.6 KB · Views: 72

Rigged Buster

L1: Registered
May 3, 2023
2
0
This might be a little too much to ask, but I think it would be cool to have a command to become a sentry buster.
 

...MrMustache...

L1: Registered
May 14, 2023
1
0
Hi hum can you add more giant (Captain punch ect....)on the plugin ,fix the spy when he backstab the giant he die instantly and when we type !giant i the chat that put the model and the voice with pls thx oh yes and last thing hum do we download all of the chatcommands ? or only 1