-
Notifications
You must be signed in to change notification settings - Fork 77
Hooks
In any gamemode, they uses pretty much hook. Since Nutscript is Open-Sourced Framework Project, NutScript has plenty of hooks to use. This list of hooks displaying what hooks NutScript is currently using, requesting.
You may find some of hooks are useful for your plugin/schema, You may find some interesting hook to test it out. I tried to provide more information about NutScript's hook to make you add some stuffs without testing how the hook is working.
If there is missing/weak information about certain hook, Feel free to notify us via Steam or GitHub.
-
boolean OnPickupMoney
Entity Activator
Money Entity
If the hook returns false, player can’t pickup the money. -
boolean "CanPlayerThrowPunch"
Punching Player
If the hook returns false, player can’t do punch attack. -
float "PlayerGetFistDamage"
Punching Player
Original Damage
Gets the fist’s damage. -
void "PlayerThrowPunch"
Punching Player
Punch Trace
This hook get fired when the player done with his/her punch damage. -
boolean "PlayerCanKnock"
Knocking Player
Knocked Entity
If the hook returns false, player can’t knock the door. -
boolean "PlayerCanOpenShipment"
Shipment Opening Player
Shipment Entity
If the hook returns false, player can’t open the shipment. -
boolean "CanPlayerUseDoor"
Interacting Player
Interacted Entity
If the hook returns false, player can’t interact with the door. -
void "PlayerUseDoor"
Interacting Player
Interacted Entity
This hook is called when player uses the door. -
void "PlayerUse"
Interacting Player
Interacted Entity
This hook is called when player pressed use key on the entity. -
boolean "CanPlayerDropItem"
Item's Owner(Player)
Dropped Item Object
If the hook returns false, player can’t drop the item. -
string "PlayerMessageSend"
Message Sender(Player)
Chat Type
Message
Is Anonymous?
This hook gets the text of the message that other player sent. -
void "PostPlayerSay"
Spoken Player
Message
Chat Type
Is Anonymous?
This hook is called when player spoken a word. -
void "PostPlayerLoadout"
Spawned Player
This hook is called right after “PlayerLoadout” hook is called. -
string "GetPlayerDeathSound"
Died Player
This hook gets the sound’s path for player’s death sound. -
string "GetPlayerPainSound"
Injured Player
This hook gets the sound’s path for player’s pain moaning sound. -
void "LoadData"
This hook is called when server loads the data. -
void "SaveData"
This hook is called when server is saves the data. -
void "OnPlayerEnterSequence"
Acting Player
Requested Sequence
Function Callback
Sequence Time
Not Stationary?
This hook is called when player is performing the sequence. -
void "OnPlayerLeaveSequence"
Acted Player
This hook is called when player is done performing the sequence. -
boolean "CanPlayerUseBusiness"
Player
Item ID
If the hook returns false, player can’t use the business menu. -
void "OnPlayerUseBusiness"
Player
Purchased Item
This hook is called when player used the business menu. -
void "OnCreateShipment"
Player
Ordered Shipment Entity
This hook is called when player ordered a shopment from the shipment menu. -
void "CharacterRestored"
Restored Character Index
This hook is called when player’s character is restored from character cache. -
string "GetDefaultCharName"
Character Owner Player
Faction Data
This hook gets the default character’s name of the faction. -
boolean "CanPlayerUseChar"
Character Owner Player
Character Index
If the hook returns false, player can’t use the character. -
void "PlayerLoadedChar"
Player
Loading Character Index
Previous(Current) Character
This hook is called when player loaded the character. -
void "AdjustCreationData"
Player
Previous Data
New Data
This hook is called when player created the character. You can use this hook to modify default character’s data. -
void "OnCharDelete"
Player
Character ID
Is Current Character?
This hook is called when player deletes his/her own character. -
void "OnCharVarChanged"
Character Index
Key
Previous Variable
Changed Variable
This hook is called when the variable of character is changed by the server. -
string "OnChatReceived"
Player
Chat Type
Message
Is Anonymous?
This hook is called when the player received the chat. -
string "GetPlayerIcon"
Speaking Player
This hook gets the OOC chat’s icon of the speaker. -
void "OnPlayerJoinClass"
Joining Player
Class ID
This hook is called when player joins to certain class. -
boolean "CanPlayerInteractItem"
Interacting Player
Action ID
Item Object
If the hook returns false, player can’t interact with item. (In any form) -
boolean "PluginShouldLoad"
Plugin ID
If the hook returns false, server does not load the plugin. -
void "DoPluginIncludes" path, PLUGIN
This hook is called when the server includes the plugins lua data. -
void "PluginLoaded" uniqueID, PLUGIN
This hook is called when the server loaded the plugins -
void “InitializedSchema”
This hook is called when the server’s schema is initialized. -
void "InitializedPlugins"
This hook is called when the server’s plugings are initialized. -
void "PluginUnloaded" uniqueID
This hook is called when the plugin is unloaded. -
boolean "CharacterPreSave"
Saving Character Index
This hook is called right before character is saved. -
void "CharacterPostSave"
Saved Character Index
This hook is called after the character is saved. -
void "InitializedConfig"
Confing Data
This hook is called when the server/client initialized the config. -
void "OnCharFallover"
Falling Player
Fallover Ragdoll Object
Is Entering?
This hook is called when the player performed /fallover. -
boolean "ShouldCleanDataItems"
If the hook returns false, the server does not clean data items. -
void "OnPlayerAreaChanged"
Player
AreaID
This hook is called when the player’s area data is changed. -
boolean "CanDisplayArea"
If the hook returns false, area display will be disabled. -
void "FinishChat"
This hook is called right after the player finished the chat. -
void "ChatTextChanged"
Chat Text
This hook is called when the text in chat input is changed. -
void "StartChat"
This hook is called when player starts the chat. -
void "PlayerSay"
Player
Chat Text
This hook is called when player said the word. -
boolean "CanPlayerAccessDoor"
Player
Door Entity
Access
If the hook returns false, player can’t interact with the door. -
boolean "IsRecognizedChatType"
Chat Type
If the hook returns false, player will get description of the speaker’s character not the name of the speaker. -
void "StorageItemRemoved"
Storage Entity
Item Object
This hook is called when the item in the storage is removed. -
boolean "CanPlayerUseVendor"
Player
Vendor Entity
If the hook returns false, the player can’t use the vendor. -
boolean "CanVendorSellItem"
Player
Vendor Entity
Item ID
If the hook returns false, the player can’t sell item to the vendor. -
boolean "CanVendorBuyItem"
Player
Vendor Entity
Item ID
If the hook returns false, the player can’t buy item to the vendor. -
void "OnCharTradeVendor"
Player
Vendor Entity
X
Y
Bag ID
Price
This hook is called when player traded an item with the trader.
-
void "LoadFonts"
Font's Name
This hook get fired when the script loads the font. -
void "BuildHelpMenu"
Panel Object
The developer can use this hook to build the help menu. -
void "CreateCharInfoText"
Panel Object
The developer can use this hook to add more information on F1 screen. -
void "CreateCharInfo"
Panel Object
The developer can use this hook to add more information on F1 screen. -
void "OnCharInfoSetup"
Panel Object
The developer can use this hook to add more information on F1 screen. -
void "CreateMenuButtons"
Panel Object
The developer can use this hook to build main menu buttons. -
void "ShowPlayerOptions"
Player
Panel Object
This hook is called when player pressed character’s avatar in scoreboard. -
void "LoadIntro"
This hook is called before character menu is created. -
void "DrawEntityInfo"
Target Entity
Drawing Alpha
The developer can use this hook to display/draw something on screen when player is looking at the entity. -
float "AdjustBlurAmount"
Blur Goal
The developer can adjust screen’s blur with this hook. -
string "GetDisplayedName"
Target Entity
This hook gets the name of the entity’s name. -
void "ItemShowEntityMenu"
Target Entity
This hook is called when player press E on the item. -
string "WeaponCycleSound"
This hook gets the sound’s path for cycling the weapon. -
string "WeaponSelectSound"
This hook gets the sound’s path for selecting the weapon.
-
void "CharacterLoaded"
Loaded Character Index
This hook get fired when the player loaded his/her character. -
void "PlayerStaminaLost"
Player
This hook is called when player lost his/her stamina. -
boolean "StorageCanTransfer"
Inventory ID
Player
Old X
Old Y
New X
New Y
New Inventory ID
If the hook returns false, the player can’t transfer item to the storage.