weapons.IsBasedOn

From Garry's Mod
Jump to: navigation, search
 weapons.IsBasedOn( )

Contents

Description

Checks if name is based on base

Arguments

string name

Entity's class name to be checked

Arguments

string base

Base class name to be checked

Returns

boolean

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

Examples

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
Personal tools
Navigation