Detecting if a player is godded

Seems like the appropriate place to put it, since its a request, I need a code snippet which will detect if a player is godded or not, so I could do ply:IsGodded() or something which produces the same results as that

[lua]local pMeta = FindMetaTable(“Player”);
local oldGodEnable = pMeta.GodEnable;
local oldGodDisable = pMeta.GodDisable;

function pMeta:GodEnable()
self.GodMode = true;
oldGodEnable();
end;

function pMeta:GodDisable()
self.GodMode = false;
oldGodDisable();
end;

function pMeta:IsGodded()
return self.GodMode;
end;[/lua]

This is the only way I can think of to do this properly. (Note how I had to overwrite the default GodEnable/GodDisable functions…)

You forgot to pass self to the old functions and you can’t add semicolons after ends.

[lua]local pMeta = FindMetaTable(“Player”);
local oldGodEnable = pMeta.GodEnable;
local oldGodDisable = pMeta.GodDisable;

function pMeta:GodEnable()
self.GodMode = true;
oldGodEnable(self);
end

function pMeta:GodDisable()
self.GodMode = false;
oldGodDisable(self);
end

function pMeta:IsGodded()
return self.GodMode;
end[/lua]

-snip- code above fixed it, thanks, still got to test if it works.

Yep, it works perfectly :slight_smile: thank you thejjoker, DarKSunrise.

Woops, thanks

You’re wrong there, you actually can.(You can’t behind function names though, e.g: function test(); <wont work)