Difference between revisions of "WD2 ScriptHook: Lua Functions"
From Nomad DB
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[WD2 ScriptHook|ScriptHook]] registers custom [[Lua]] functions to the game's scripting system. | + | [[WD2 ScriptHook|ScriptHook]] registers custom [[Lua]] functions to the game's scripting system. These functions extend the [[WD2 Lua Functions|built-in Lua functions]] and [[WD2 Lua Classes|Game classes]] and provide additional functionality. |
− | == Generic == | + | ==Generic== |
− | |||
− | + | *[[include]] | |
− | * [[ | ||
− | |||
− | |||
− | === | + | ===Script=== |
− | |||
− | |||
− | == Game Functions == | + | *[[WD2 ScriptHook: Script Table|Script()]] |
− | === Player === | + | *[[ScriptHook.RegisterKeyHandler]] |
− | * [[ScriptHook.AddInventoryItem]] | + | *[[ScriptHook.RegisterCommand]] |
− | * [[ScriptHook.Teleport]] | + | |
− | * [[ScriptHook.SetGraphicKitModel]] | + | ===UI=== |
− | === Vehicle === | + | |
− | * [[ScriptHook.RepairLocalPlayerVehicle]] | + | *[[UI.SimpleMenu]] |
− | === Felony === | + | *[[ScriptHook.ShowNotification]] |
− | * [[ScriptHook.ToggleFelonySystem]] | + | *[[ScriptHook.IsIngameUIEnabled]] |
− | * [[ScriptHook.SetHeatLevel]] | + | |
− | * [[ScriptHook.ClearHeatLevel]] | + | ==Game Functions== |
− | === Game === | + | ===Player=== |
− | * [[ScriptHook.SetProgression]] | + | |
+ | *[[ScriptHook.AddInventoryItem]] | ||
+ | *[[ScriptHook.Teleport]] | ||
+ | *[[ScriptHook.SetGraphicKitModel]] | ||
+ | *[[ScriptHook.SetLocalPlayerNoclip]] | ||
+ | *[[ScriptHook.HasLocalPlayerNoclip]] | ||
+ | |||
+ | ===Entity=== | ||
+ | |||
+ | *[[ScriptHook.SpawnEntityFromArchetypeHash]] | ||
+ | *[[ScriptHook.GetArchetypeHashByEntityId]] | ||
+ | *[[ScriptHook.GetGraphicKitModelByEntityId]] | ||
+ | *[[ScriptHook.SetEntityGraphicKitModel]] | ||
+ | |||
+ | ===Vehicle=== | ||
+ | |||
+ | *[[ScriptHook.RepairLocalPlayerVehicle]] | ||
+ | |||
+ | ===Felony=== | ||
+ | |||
+ | *[[ScriptHook.ToggleFelonySystem]] | ||
+ | *[[ScriptHook.SetHeatLevel]] | ||
+ | *[[ScriptHook.ClearHeatLevel]] | ||
+ | |||
+ | ===Game=== | ||
+ | |||
+ | *[[ScriptHook.SetProgression]] | ||
+ | *[[ScriptHook.ToggleWorldSpawner]] | ||
+ | *[[ScriptHook.IsWorldSpawnerEnabled]] | ||
+ | *[[ScriptHook.ToggleWorldImpostor]] | ||
+ | *[[ScriptHook.IsWorldImpostorEnabled]] | ||
+ | |||
+ | ===Camera=== | ||
+ | |||
+ | *[[ScriptHook.CameraSetCustom]] | ||
+ | *[[ScriptHook.CameraReset]] | ||
+ | *[[ScriptHook.SetLocalPlayerFreeCamera]] | ||
+ | *[[ScriptHook.HasLocalPlayerFreeCamera]] | ||
+ | |||
+ | ==Utility== | ||
+ | ===timer=== | ||
+ | |||
+ | *[[timer.Create]] | ||
+ | *[[timer.Simple]] | ||
+ | *[[timer.Get]] | ||
+ | *[[timer.Remove]] | ||
+ | *[[timer.RemoveIfExists]] |
Revision as of 18:43, 3 May 2020
ScriptHook registers custom Lua functions to the game's scripting system. These functions extend the built-in Lua functions and Game classes and provide additional functionality.
Contents
Generic
Script
UI
Game Functions
Player
- ScriptHook.AddInventoryItem
- ScriptHook.Teleport
- ScriptHook.SetGraphicKitModel
- ScriptHook.SetLocalPlayerNoclip
- ScriptHook.HasLocalPlayerNoclip
Entity
- ScriptHook.SpawnEntityFromArchetypeHash
- ScriptHook.GetArchetypeHashByEntityId
- ScriptHook.GetGraphicKitModelByEntityId
- ScriptHook.SetEntityGraphicKitModel
Vehicle
Felony
Game
- ScriptHook.SetProgression
- ScriptHook.ToggleWorldSpawner
- ScriptHook.IsWorldSpawnerEnabled
- ScriptHook.ToggleWorldImpostor
- ScriptHook.IsWorldImpostorEnabled
Camera
- ScriptHook.CameraSetCustom
- ScriptHook.CameraReset
- ScriptHook.SetLocalPlayerFreeCamera
- ScriptHook.HasLocalPlayerFreeCamera