Well unless TEAM_MODERATOR is a table full of teams that would classify them as staff then probably not. You'd be better off by something closer to this...
if ply:Team() == TEAM_MODERATOR or ply:IsSuperAdmin() then
-- blah blah blah
end
You misinterpret my table check.
But regardless, I think I have a final version for the script.
hook.Add("PlayerNoClip", "PreventTheNoclip", function(ply, isallowed)
if !isallowed then
if table.HasValue({TEAM_MODERATOR}, ply:Team()) or ply:IsSuperAdmin then
ply:ConCommand("ulx noclip")
end
end
if isallowed then return end
end)I have not tested this at a computer yet. I am on a work laptop.
First, there was the problem with the hook. PlayerNoClip definitely looked like the hook I was looking for, so thank you for pointing me towards that. Second, the way I was addressing the function would not work with the PlayerNoClip hook. That has two identifiers:
player, and IsNoclipAllowed. Therefore, I changed it so that if noclip is NOT allowed then we initiate the script. However, if it is allowed, we return the script.
Again, I have not tested this out. I will test it when I get home.