This gamemode is a re-write from scratch of a popular gamemode that has been discontinued. This projet is heavily maintened by myself, and I'm open to any suggestions or pull requests. You can at the same time if you want click here to join the Discord server.
!! This gamemode is still in development, and is not ready to be used on an active server !!
The BaseWars gamemode is a gamemode where you can build your own base, buy weapons, and fight against other players. You can also create your own faction, and raid other factions.
The gamemode contains a lot of features, and is very customizable. You can add your own weapons, entities, and more.
Almost all can be done through the config file, and the gamemode is very easy to setup. There is no need of an in-depth knowledge of lua to setup the gamemode.
Nonetheless if you want to add your own weapons, entities, or anything else, you will need to know lua and how the structure of the gamemode works.
Simply download the gamemode, and put it in your server's gamemodes folder.
Located at modules/net/cl_net.lua: Line 4
function BaseWars.Net.SendToServer(msgType, data)
Send a network message to the server.
- Parameter
msgType
(string): The network message type. - Parameter
data
(table): The data to send.
Located at modules/spawnmenu/cl_spawnmenu.lua: Line 6
function Player:BuyEntity(uuid)
No documentation available for now.
Located at modules/spawnmenu/cl_spawnmenu.lua: Line 12
function Player:SetAutoBuy(bool, weapon)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 4
function BaseWars.ConVar.Register(var, name, default, helpText)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 16
function BaseWars.ConVar.CreateConVarHandler(convarName, isBool, callback)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 49
function BaseWars.ConVar.Get(name)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 66
function BaseWars.ConVar.Set(name, value)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 70
function BaseWars.ConVar.Reset(name)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 74
function BaseWars.ConVar.GetDefault(name)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 78
function BaseWars.ConVar.GetDescription(name)
No documentation available for now.
Located at modules/persistent/cl_persistent.lua: Line 82
function BaseWars.ConVar.GetVar(name)
No documentation available for now.
Located at modules/faction/cl_faction.lua: Line 57
function BaseWars.Faction.TryJoinFaction(name, password)
Attempts to join a faction with the given name and password.
- Parameter
name
(string): The name of the faction to join. - Parameter
password
(string): The password of the faction to join.
Located at modules/faction/cl_faction.lua: Line 68
function BaseWars.Faction.TryLeaveFaction(name)
Attempts to leave the faction with the given name.
- Parameter
name
(string): The name of the faction to leave.
Located at modules/faction/cl_faction.lua: Line 78
function BaseWars.Faction.TryCreateFaction(name, password, color, icon)
Attempts to delete the faction with the given name.
- Parameter
name
(string): The name of the faction to delete.
Located at modules/faction/cl_faction.lua: Line 88
function BaseWars.Faction.TryKickPlayer(target)
No documentation available for now.
Located at modules/language/cl_lang.lua: Line 3
function BaseWars.Languages.SetCached(value)
No documentation available for now.
Located at modules/language/cl_lang.lua: Line 29
function BaseWars.GetLocalPlayerLanguage()
No documentation available for now.
Located at shared.lua: Line 16
function BaseWars.Log(...)
Logs a message to the console.
@param {any} ... - The message to log.
Located at shared.lua: Line 29
function BaseWars.Color(code)
Loads a module.
- Parameter
name
(string): The name of the module to load.
Located at shared.lua: Line 49
function BaseWars.Lang(phrase, ...)
No documentation available for now.
Located at shared.lua: Line 79
function BaseWars.GetLocalPlayerLanguage()
No documentation available for now.
Located at shared.lua: Line 85
function BaseWars.TryTranslate(phrase)
No documentation available for now.
Located at shared.lua: Line 114
function BaseWars.RegisterLanguage(lang, tbl)
No documentation available for now.
Located at shared.lua: Line 118
function BaseWars.ValidClose(ply, ent, range)
No documentation available for now.
Located at shared.lua: Line 124
function BaseWars.FindPlayerByName(name)
No documentation available for now.
Located at shared.lua: Line 132
function BaseWars.NumberFormat(n)
No documentation available for now.
Located at shared.lua: Line 147
function BaseWars.FormatMoney(n)
Formats a number into a money string.
- Parameter
n
(number): The number to format.
Located at shared.lua: Line 157
function BaseWars.CreateFakeDerivatedScriptedEnt(baseEntity, printName, model, ClassName)
Registers a new entity based on an existing entity. Fake registering without having to create a new file.
- Parameter
baseEntity
(string): The base entity to derive from. - Parameter
printName
(string): The name of the entity. - Parameter
model
(string): The model of the entity. - Parameter
ClassName
(string): The class name of the entity.
Located at shared.lua: Line 184
function BaseWars.CreateFakeDerivedWeapon(baseWeapon, newPrintName, newClassName, customizations)
Registers a new weapon based on an existing weapon. Fake registering without having to create a new file.
- Parameter
baseWeapon
(string): The base weapon to derive from. - Parameter
newPrintName
(string): The name of the weapon. - Parameter
newClassName
(string): The class name of the weapon. - Parameter
customizations
(function): A function to customize the weapon.
Located at shared.lua: Line 219
function BaseWars.LoadEntityConfiguration()
Loads Entity configuration from the config file, in order to create entities.
Located at shared.lua: Line 254
function BaseWars.LoadWeaponConfiguration()
No documentation available for now.
Located at modules/sh_modules.lua: Line 6
function BaseWars.RegisterModule(name, dependencies, path, prefix)
Registers a module with optional dependencies.
- Parameter
name
(string): The name of the module. - Parameter
dependencies
(table): A table of dependencies for the module. - Parameter
path
(string): The path to the module. - Parameter
prefix
(string): The prefix of the module.
Located at modules/sh_modules.lua: Line 59
function BaseWars.IncludeModules()
Loads all modules in the order they were registered.
Located at modules/sh_modules.lua: Line 75
function BaseWars.RegisterModuleFolder(folder, dependencies)
Registers all modules in a folder with optional dependencies.
- Parameter
folder
(string): The folder to register modules in. - Parameter
dependencies
(table): A table of dependencies to use for all modules in the folder.
Located at modules/research/sh_research.lua: Line 20
function BaseWars.Research.GetModuleByName(name)
No documentation available for now.
Located at modules/net/sh_net.lua: Line 51
function BaseWars.Net.Register(msgType, structure)
Register a network message type.
- Parameter
msgType
(string): The network message type. - Parameter
structure
(table): The structure of the network message.
Example:
BaseWars.Net.Register("BaseWars_BuyEntity", {
uuid = "string",
})
Located at modules/net/sh_net.lua: Line 76
function BaseWars.Net.Read(msgType)
Read a network message based on a structure.
- Parameter
msgType
(string): The network message type.
Example:
local data = BaseWars.Net.Read("BaseWars_BuyEntity")
local uuid = data.uuid
Located at modules/net/sh_net.lua: Line 109
function BaseWars.Net.Write(msgType, data)
Write a network message based on a structure, this is the opposite of BaseWars.Net.Read.
- Parameter
msgType
(string): The network message type. - Parameter
data
(table): The data to send.
Example:
BaseWars.Net.Write("BaseWars_BuyEntity", {
uuid = "some_uuid",
})
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 32
function BaseWars.SpawnMenu.GenerateUUID(item)
Generates a UUID for a given item. Using the item's properties, a UUID is generated using a simple algorithm. The UUID is generated using a template and a seeded pseudo-random number generator. Which means both client and server will generate the same UUID for the same item. It is useful for identifying items in the shop, and it can also prevent duplicate items from being added to the shop. Futhermore if someone tries manually launching fake items, the UUID will be different and the server will reject it. Was a problem in the original basewars gamemode the server could get confuse and would accept the fake item in very rare cases.
-
Parameter
item
(table): The item to generate a UUID for. -
Returns
string
: The generated UUID.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 74
function BaseWars.SpawnMenu.AddUUIDsToShop(categoryTable)
Adds UUIDs to the shop's item entries. The UUIDs are generated using the item's properties, and are used to uniquely identify items in the shop.
-
Parameter
categoryTable
(table): The table representing the shop's categories. -
Returns
table
: The updated category table.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 110
function BaseWars.SpawnMenu.CollectItems(categoryTable, depth)
Collects all items from the shop's category table, recursively. Go through each category and subcategory, collecting all items into a single table.
-
Parameter
categoryTable
(table): The table representing the shop's categories. -
Parameter
depth
(number): The maximum depth to recurse to. -
Returns
table
: A table containing all items from the shop's category table.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 145
function BaseWars.FlattenShop()
Flattens the shop's category table into a single table containing all items. The table is stored in BaseWars.SpawnMenu.FlattenedShop. Useful for searching and filtering items. This is stored in a separate table to avoid modifying the original shop table. Also, it's only computed once. (normally) The client can use this table to display the shop's items, and the server can use it to validate purchases fastly.
- Returns
table
: A table containing all items from the shop's category table.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 162
function BaseWars.SpawnMenu.GetWeaponAutoBuy(ply)
No documentation available for now.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 168
function Player:GetBuyEntityBlockReason(uuid)
No documentation available for now.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 181
function Player:IsVIP()
No documentation available for now.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 185
function Player:GetIsWeaponAutoBuy()
No documentation available for now.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 189
function Player:GetWeaponAutoBuy()
No documentation available for now.
Located at modules/spawnmenu/sh_spawnmenu.lua: Line 193
function Player:GetEntityCount(class)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 49
function Faction:GetMembers()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 53
function Faction:GetName()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 57
function Faction:HasPassword()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 61
function Faction:GetPassword()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 65
function Faction:GetColor()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 69
function Faction:GetIcon()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 73
function Faction:GetLeader()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 77
function Faction:GetMemberCount()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 83
function BaseWars.Faction.GetFactions()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 87
function BaseWars.Faction.GetFaction(name)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 91
function BaseWars.Faction.GetFactionByMember(ply)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 99
function Player:GetFaction()
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 103
function Player:IsFriendlyEntity(ent)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 108
function BaseWars.Faction.ValidateName(name)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 121
function BaseWars.Faction.ValidatePassword(password)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 128
function BaseWars.Faction.ValidateColor(color)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 135
function BaseWars.Faction.ValidateIcon(icon)
No documentation available for now.
Located at modules/faction/sh_faction.lua: Line 142
function BaseWars.Faction.Exists(name)
No documentation available for now.
Located at modules/money/sh_money.lua: Line 6
function Player:CanAfford(amount)
Config
BaseWars.Money.Config = BaseWars.Money.Config or {}
BaseWars.Money.Config.StartAmount = 1000
Player functions
Located at modules/money/sh_money.lua: Line 24
function Player:GetMoney()
No documentation available for now.
Located at modules/raid/sh_raid.lua: Line 31
function BaseWars.Raid.GetRemainingTime(time, points)
No documentation available for now.
Located at modules/raid/sh_raid.lua: Line 35
function BaseWars.Raid.GetRemainingPoints(time, points)
No documentation available for now.
Located at modules/level/sh_level.lua: Line 3
function Player:GetLevel()
No documentation available for now.
Located at modules/level/sh_level.lua: Line 7
function Player:CanAffordLevel(level)
No documentation available for now.
Located at modules/level/sh_level.lua: Line 11
function Player:GetXP()
No documentation available for now.
Located at modules/level/sh_level.lua: Line 24
function Player:GetXPForLevel(level)
No documentation available for now.
Located at modules/level/sh_level.lua: Line 28
function Player:GetXPForNextLevel()
No documentation available for now.
Located at modules/level/sh_level.lua: Line 32
function Player:GetLevelForXP(xp)
No documentation available for now.
Located at modules/entities/sh_entities.lua: Line 28
function BaseWars.Entities.GetUpgradeCost(ent)
No documentation available for now.
Located at modules/entities/modules/sh_module.lua: Line 5
function BaseWars.Entity.Modules:Add(module)
No documentation available for now.
Located at modules/entities/modules/sh_module.lua: Line 18
function BaseWars.Entity.Modules:Remove(name)
No documentation available for now.
Located at modules/entities/modules/sh_module.lua: Line 22
function BaseWars.Entity.Modules:Get(name)
No documentation available for now.
Located at init.lua: Line 66
function BaseWars.SequentialDataSaving()
No documentation available for now.
Located at modules/research/sv_research.lua: Line 3
function BaseWars.Research.OpenMenu(ent, ply)
No documentation available for now.
Located at modules/research/sv_research.lua: Line 11
function BaseWars.Research.ResearchModule(ent, moduleName, ply)
No documentation available for now.
Located at modules/research/sv_research.lua: Line 38
function BaseWars.Research.InitializePlayer(ply)
No documentation available for now.
Located at modules/research/sv_research.lua: Line 44
function BaseWars.Research.ApplyEffect(ply, module)
No documentation available for now.
Located at modules/research/sv_research.lua: Line 52
function BaseWars.Research.ApplyAllEffects(ply)
No documentation available for now.
Located at modules/notify/sv_notify.lua: Line 2
function BaseWars.Notify.Send(ply, title, message, color)
No documentation available for now.
Located at modules/notify/sv_notify.lua: Line 11
function BaseWars.Notify.Group(group, title, message, color)
No documentation available for now.
Located at modules/notify/sv_notify.lua: Line 20
function BaseWars.Notify.Faction(faction, title, message, color)
No documentation available for now.
Located at modules/notify/sv_notify.lua: Line 34
function BaseWars.Notify.Broadcast(title, message, color)
No documentation available for now.
Located at modules/net/sv_net.lua: Line 4
function BaseWars.Net.Broadcast(msgType, data)
Broadcast a network message to all players.
- Parameter
msgType
(string): The network message type. - Parameter
data
(table): The data to send.
Located at modules/net/sv_net.lua: Line 19
function BaseWars.Net.SendToPlayer(ply, msgType, data)
Send a network message to a player.
- Parameter
ply
(Player): The player to send the message to. - Parameter
msgType
(string): The network message type. - Parameter
data
(table): The data to send.
Located at modules/net/sv_net.lua: Line 37
function BaseWars.Net.SendToGroup(group, msgType, data)
Send a network message to a group of players.
- Parameter
group
(table): The group of players to send the message to. - Parameter
msgType
(string): The network message type. - Parameter
data
(table): The data to send.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 7
function Player:AddToEntityCount(class, amount)
No documentation available for now.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 13
function Player:CheckEntityLimit(class, limit)
No documentation available for now.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 74
function BaseWars.SpawnMenu.BuyEntity(ply, uuid, pos, ang)
Attempts to buy an entity for the player.
-
Parameter
ply
(Player): The player entity to buy the entity for. -
Parameter
uuid
(string): The UUID of the entity to buy. -
Parameter
pos
(Vector): The position to spawn the entity at. -
Parameter
ang
(Angle): The angle to spawn the entity at. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 127
function BaseWars.SpawnMenu.CalcPosAndAng(ply, ent)
Calculates the position and angle to spawn an entity at based on the player's current view.
-
Parameter
ply
(Player): The player entity to calculate the position and angle for. -
Parameter
uuid
(string): The UUID of the entity to calculate the position and angle for. -
Returns
Vector, Angle
: The position and angle to spawn the entity at.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 176
function BaseWars.SpawnMenu.SetWeaponForAutoBuy(ply, uuid)
No documentation available for now.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 177
function BaseWars.SpawnMenu.DisableWeaponAutoBuy(ply)
No documentation available for now.
Located at modules/spawnmenu/sv_spawnmenu.lua: Line 184
function BaseWars.SpawnMenu.ActivateWeaponAutoBuy(ply, uuid, state)
No documentation available for now.
Located at modules/props/sv_props.lua: Line 1
function BaseWars.Props.FindPlayerProps(ply)
No documentation available for now.
Located at modules/faction/sv_faction.lua: Line 6
function Faction:SetLeader(leader)
Sets the specified player as the leader of the faction.
- Parameter
leader
(Player): The player entity to set as the leader of the faction.
Located at modules/faction/sv_faction.lua: Line 16
function Player:SetFaction(faction)
Sets the faction for the player. If a faction object is provided, it uses the faction's name.
- Parameter
faction
(string|table): The faction name or faction table to associate with the player.
Located at modules/faction/sv_faction.lua: Line 27
function BaseWars.Faction.Initialize()
Initializes the factions system, ensuring the factions table is set up and synchronizes factions.
Located at modules/faction/sv_faction.lua: Line 53
function BaseWars.Faction.CreateFaction(name, password, color, icon, leader)
Attempts to create a new faction with the provided parameters and sets the leader.
-
Parameter
name
(string): The unique name of the faction. -
Parameter
password
(string): The password for the faction, if any. -
Parameter
color
(Color): The color associated with the faction. -
Parameter
icon
(string): The icon representing the faction. -
Parameter
leader
(Player): The player entity to set as the initial leader of the faction. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/faction/sv_faction.lua: Line 118
function BaseWars.Faction.SyncFactions(ply)
Synchronizes all faction data with a specific player or all players if no player is specified.
- Parameter
ply
(Player): The player to synchronize with. If nil, synchronizes with all players.
Located at modules/faction/sv_faction.lua: Line 139
function BaseWars.Faction.SyncFaction(factionName, faction)
Synchronizes a specific faction's details with all players.
- Parameter
faction
(table): The faction table containing faction details to synchronize.
Located at modules/faction/sv_faction.lua: Line 158
function BaseWars.Faction.JoinFaction(ply, factionName, password)
Handles the process of a player attempting to join a faction, including password verification.
-
Parameter
ply
(Player): The player attempting to join the faction. -
Parameter
factionName
(string): The name of the faction the player is attempting to join. -
Parameter
password
(string): The password provided by the player for the faction, if required. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/faction/sv_faction.lua: Line 201
function BaseWars.Faction.LeaveFaction(ply)
Handles the process of a player leaving their current faction.
-
Parameter
ply
(Player): The player leaving the faction. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/faction/sv_faction.lua: Line 234
function BaseWars.Faction.DeleteFaction(name)
Deletes a faction with the given name from the server.
-
Parameter
name
(string): The name of the faction to delete. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/faction/sv_faction.lua: Line 267
function BaseWars.Faction.SetFaction(ply, name, leader)
Sets the faction for a player directly, optionally setting them as the leader.
-
Parameter
ply
(Player): The player to set the faction for. -
Parameter
name
(string): The name of the faction to set. @param {boolean} [leader] - Whether the player should also be set as the leader of the faction. -
Returns
boolean, string
: A status indicating success or failure, and a message explaining the result.
Located at modules/faction/sv_faction.lua: Line 295
function BaseWars.Faction.KickPlayer(ply, target)
No documentation available for now.
Located at modules/leaderboard/sv_leaderboard.lua: Line 8
function BaseWars.Leaderboard.RefreshPage(page)
No documentation available for now.
Located at modules/leaderboard/sv_leaderboard.lua: Line 14
function BaseWars.Leaderboard.Send(ply)
No documentation available for now.
Located at modules/leaderboard/sv_leaderboard.lua: Line 20
function BaseWars.Leaderboard.Refresh()
No documentation available for now.
Located at modules/leaderboard/sv_leaderboard.lua: Line 32
function BaseWars.Leaderboard.Think()
No documentation available for now.
Located at modules/money/sv_money.lua: Line 3
function Player:AddMoney(amount)
No documentation available for now.
Located at modules/money/sv_money.lua: Line 7
function Player:TakeMoney(amount)
No documentation available for now.
Located at modules/money/sv_money.lua: Line 11
function Player:SetMoney(amount)
No documentation available for now.
Located at modules/money/sv_money.lua: Line 15
function Player:GiveMoney(amount)
No documentation available for now.
Located at modules/raid/sv_raid.lua: Line 175
function BaseWars.Raid.StartRaid(factionName, targetName, start)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 6
function Player:SetLevel(level)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 10
function Player:AddLevel(level)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 14
function Player:TakeLevel(level)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 20
function Player:SetXP(xp)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 24
function Player:AddXP(xp)
No documentation available for now.
Located at modules/level/sv_level.lua: Line 37
function Player:TakeXP(xp)
No documentation available for now.
Located at modules/radar/sv_radar.lua: Line 4
function BaseWars.Radar.GetRaidableEntitieWithinRadius(pos, radius)
No documentation available for now.
Located at modules/radar/sv_radar.lua: Line 19
function BaseWars.Radar.FindRaidableEntitiesAroundRadar(radar)
No documentation available for now.
Located at modules/radar/sv_radar.lua: Line 27
function BaseWars.Radar.SendRaidableEntities(ply, radar)
No documentation available for now.
Located at modules/radar/sv_radar.lua: Line 33
function BaseWars.Radar.AskForRaidableEntities(ply, radar)
No documentation available for now.
Located at modules/entities/sv_entities.lua: Line 4
function BaseWars.Entities.FindPlayerEntities(ply)
Returns all entities owned by a player.
- Parameter
ply
(Player): The player to find entities for.
Located at modules/entities/sv_entities.lua: Line 22
function BaseWars.Entities.SellEntity(ply, ent)
Sells an entity for a player.
- Parameter
ply
(Player): The player selling the entity. - Parameter
ent
(Entity): The entity being sold.
Located at modules/entities/sv_entities.lua: Line 58
function BaseWars.Entities.UpgradeEntity(ply, ent)
if not ent:CanSell() then BaseWars.Notify.Send(ply, "You cannot sell this entity!") return end
-- Will call the remove hook and give the player money back no need to do it here -- ply:AddMoney(value) ent:Remove()
local value = ent:GetValue() BaseWars.Notify.Send(ply, "You sold an entity for " .. value .. "!") end
Upgrades an entity for a player.
- Parameter
ply
(Player): The player upgrading the entity. - Parameter
ent
(Entity): The entity being upgraded. - Parameter
upgrade
(string): The upgrade being applied.