GSC reference › Built-in
AllowMelee()
Built-in (engine)
Server
Player Called on: player
Sets whether the player can melee
Signature
<player> AllowMelee(<melee>)
Called on an entity: player AllowMelee(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| melee | Required | A boolean. True if the player can melee, and false otherwise |
Example (from Treyarch's docs)
player AllowMelee(false)
Real uses in BO3's scripts
Called 11 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_devgui.gsc, line 1130
melee = self allowmelee(0); - scripts/zm/_zm_utility.gsc, line 6511
self allowmelee(0); - scripts/zm/_zm_weap_ball.gsc, line 1914
self allowmelee(0); - scripts/mp/gametypes/ball.gsc, line 1991
self allowmelee(0); - scripts/mp/gametypes/sniperonly.gsc, line 119
self allowmelee(0);
Related built-ins
- MeleeButtonPressed()Check if the player is pressing the melee button
- IsMeleeing()Returns true if the player is currently meleeing
- AllowMeleePowerLeft()Sets whether the player can melee power left
- finishMeleeHit()Notifies the clients of the melee hit or miss
- Melee()Makes this actor melee attack.
- isUsingT7Melee()Returns true T7 Melee system is being used
- GetMeleeChainCount()Gets the number of melee kills achieved by the player within their current streak.
- IsGadgetMeleeCharging()Is the player in the process of melee charging
- queuemeleeactionstate()Sets the queued action state to melee for the player's default hand.
- GetCurrentWeaponIncludingMelee()Returns the name of the weapon being used by the specified local client, and will return the melee weapon if the client is in a melee state
- MeleeWithOffset()Makes this actor melee attack.
- GetCurrentWeapon()Gets the current player weapon
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).