ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. isValidWeaponID

Function

isValidWeaponID

Server and clientWeaponsTrilogy Hub only

Checks whether an ID is a weapon used in the game (0-46, skipping unused numbers).

Syntax

bool isValidWeaponID(int weapon)

Arguments

weaponint
The ID to check.

Returns

true for a real weapon.

Example

if isValidWeaponID(tonumber(arg)) then
    giveWeapon(player, tonumber(arg), 100)
end