getWeaponState
Client-side
Server-side
Shared
Pair: setWeaponState
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function gets the state of a custom weapon.
Syntax
getWeaponState ( )Code Examples
client
This example creates a gun where the local player is and informs any player about its state.
local function testWeaponState() local weapon = createWeapon("m4", getElementPosition(localPlayer)) -- Create the weapon outputChatBox("The weapon that has just been created state is " .. getWeaponState(weapon) .. ".") -- Tell the player its stateendaddEventHandler("onClientResourceStart", resourceRoot, testWeaponState)