Community Contributions
< Team Fortress 2 | Scripting
Jump to navigation
Jump to search


This page contains code contributions and tips from the TF2Maps.net Discord for VScript in
Team Fortress 2

Hooks
Some of these contributions are Hooks or Game events, learn Here on how to listen to them.
Script List
Name | Description | Usage | Code |
---|---|---|---|
Change Halloween Scenario | Allows to enable hardcoded stuff from specific halloween maps anywhere else. Check this list for all of them
ExpandScenarios ![]() |
Run the following code on tf_gamerules. | NetProps.SetPropInt(self, "m_halloweenScenario", 0-5)
|
Health gain on HUD | Show to a player a custom amount of gained HP ![]()
|
Call the following event, specifying who is the player. | SendGlobalGameEvent("player_healonhit", {
entindex = player.entindex(),
amount = healAmount
});
|
Add or Remove score in RD/PD Destruction (Player and Objective less) | This is so far the only way to change the score if the base gamemode is used differently than his original intent. | Run this script anywhere, and call the two Functions. |
ExpandContents
|
Hook ↑ Changing Killicon | Force to display custom killicons if the user died to something specific, by spawning a dummy entity and changing his classname. ![]() |
myCustomInflictor <- SpawnEntityFromTable("info_target", { classname = "bumper_kart" }); //Replace "bumper_kart" with the kill icon you want to use
OnScriptHook_OnTakeDamage = function(params)
{
if (/* insert your condition */)
params.inflictor = myCustomInflictor;
}
|