game/GetSkillLevel

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added tip about using this function in NPC code)
(Added note that this is tied to the gamerules entity and what to do)
Line 3: Line 3:
  
 
'''TIP:''' You can use this function in your scripted NPCs or Nextbots to make them harder, however, it is a good idea to lock powerful attacks behind the highest difficulty instead of just increasing the health.
 
'''TIP:''' You can use this function in your scripted NPCs or Nextbots to make them harder, however, it is a good idea to lock powerful attacks behind the highest difficulty instead of just increasing the health.
 +
 +
{{Note|Internally this is tied with the gamerules entity, so you'll have to wait to wait until {{HookFunction|GM|InitPostEntity}} is called to use this }}
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=No
 
|IsClass=No
|Name=GetSkillLevel
 
|Parent=game
 
 
}}
 
}}
 
{{Ret
 
{{Ret

Revision as of 14:18, 20 November 2016

 game.GetSkillLevel( )

Description

Returns the difficulty level of the game.

TIP: You can use this function in your scripted NPCs or Nextbots to make them harder, however, it is a good idea to lock powerful attacks behind the highest difficulty instead of just increasing the health.

NOTE

Internally this is tied with the gamerules entity, so you'll have to wait to wait until GM:InitPostEntity is called to use this

Returns

number

The difficulty level, Easy( 1 ), Normal( 2 ), Hard( 3 ).
Personal tools
Navigation