Garry's Mod Wiki


  boolean Player:HasGodMode()


Returns whether the player has god mode or not, contolled by Player:GodEnable and Player:GodDisable.

This is not synced between the client and server. This will cause the client to always return false even in godmode.

Issue Tracker: 2038


1 boolean
Whether the player has god mode or not.


A fix for accessing this data on client side since you can't at the moment.

if CLIENT then local meta = FindMetaTable( "Player" ) function meta:HasGodMode() return self:GetNWBool( "HasGodMode" ) end end if SERVER then local meta = FindMetaTable( "Player" ) meta.DefaultGodEnable = meta.DefaultGodEnable or meta.GodEnable meta.DefaultGodDisable = meta.DefaultGodDisable or meta.GodDisable function meta:GodEnable() self:SetNWBool( "HasGodMode", true ) self:DefaultGodEnable() end function meta:GodDisable() self:SetNWBool( "HasGodMode", false ) self:DefaultGodDisable() end end