Garry's Mod Wiki

Garry's Mod Wiki

  boolean weapons.IsBasedOn( string name, string base )

Description

Checks if name is based on base

Arguments

1 string name
Entity's class name to be checked
2 string base
Base class name to be checked

Returns

1 boolean
Returns true if class name is based on base, else false.

Example

See if gmod_tool is based on weapon_base, and whether weapon_base is based on itself.

print(weapons.IsBasedOn("gmod_tool", "weapon_base"), weapons.IsBasedOn("weapon_base", "weapon_base"))
Output: true
false

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...