how to check if a certain player has godmode enabled ?
Is this player an admin?
i just wanna do a check on a player if he has godmode enabled or not
like
LocalPlayer():InsertGodModeDetectionHere()
You’ll have to overwrite the godmode functions.
[lua]
local gmodeenable = _R.Player.GodEnable
function _R.Player:GodEnable()
self.GodMode = true
gmodeenable(self)
end
local gmodedisable = _R.Player.GodDisable
function _R.Player:GodDisable()
self.GodMode = false
gmodedisable(self)
end
function _R.Player:HasGodMode()
return self.GodMode
end
[/lua]
This code is placed server-side?
Yes
There is no way to check clientside if the player is in god mode, as far as I am aware. The server would have to network it to the client. ( Given you asked for LocalPlayer( ):IsInGodMode( ) )
Yeh you would have to NWInt for clientside or there is no way.
not even on myself?
[lua]
local gmodeenable = _R.Player.GodEnable
function _R.Player:GodEnable()
self:SetNWINt(“GodMode”,1)
gmodeenable(self)
end
local gmodedisable = _R.Player.GodDisable
function _R.Player:GodDisable()
self:SetNWINt(“GodMode”,0)
gmodedisable(self)
end
–Clientside
function _R.Player:HasGodMode()
return self:GetNWINt(“GodMode”)
end
[/lua]