[CODE]hook.Add("PlayerNoClip", "CloakGodNoclip", function(ply, noclip)
if noclip then
ply:SetNoDraw(true)
for k, v in pairs(ply:GetWeapons()) do v:SetNoDraw(true) end
for k,v in pairs(ents.FindByClass("physgun_beam")) do if v:GetParent() == ply then v:SetNoDraw(true) end end
if SERVER then ply:GodEnable() end
else
ply:SetNoDraw(false)
for k, v in pairs(ply:GetWeapons()) do v:SetNoDraw(false) end
for k,v in pairs(ents.FindByClass("physgun_beam")) do if v:GetParent() == ply then v:SetNoDraw(false) end end
if SERVER then ply:GodDisable() end
end
end)[/CODE]
Trying to figure out how to allow this for certain ulx groups or just admins in general.
Where you have if noclip replace with.
if noclip and ply:IsAdmin() then
EDIT: Also this is a serversided hook.
[QUOTE=MarZ333;52477328]Where you have if noclip replace with.
if noclip and ply:IsAdmin() then
EDIT: Also this is a serversided hook.[/QUOTE]
That would still run the bottom half which is still redundant.
Append the following to the top of the hook callback to avoid non-admins.
[CODE]
if not ply:IsAdmin () then return end
[/CODE]
[QUOTE=Potatofactory;52477424]That would still run the bottom half which is still redundant.
Append the following to the top of the hook callback to avoid non-admins.
[CODE]
if not ply:IsAdmin () then return end
[/CODE][/QUOTE]
Ok thanks! I'm fairly new to this and get stuck easily...
[QUOTE=Potatofactory;52477424]That would still run the bottom half which is still redundant.
Append the following to the top of the hook callback to avoid non-admins.
[CODE]
if not ply:IsAdmin () then return end
[/CODE][/QUOTE]
Oh yeah, forgot about that part, oh well it's still good since it would drop people that have noclip out of it.
[QUOTE=MarZ333;52477810]Oh yeah, forgot about that part, oh well it's still good since it would drop people that have noclip out of it.[/QUOTE]
Except they'll never be noclipped because of the hook :v:
[QUOTE=JasonMan34;52478353]Except they'll never be noclipped because of the hook :v:[/QUOTE]
But he only wanted staff to be nocliped?
Thus if some magical way a player had noclip and presses the bind it will take them out of noclip too.
Sorry, you need to Log In to post a reply to this thread.