Restrict Context menu

Does anyone know how to restrict content menu buttons such as Remove, Ignite, etc to Admin only?
Cant find anything on google. Help’s appreciated.

You’ll need to find out the exact name of the context menu option, you could use a print for that as part of this code;


local cantdo = {
  ["ignite"] = true,
  ["remover"] = true,
  -- add more here
}

hook.Add("CanProperty", "restrict_properties", function(ply, property, ent)
  if cantdo[property] and not ply:IsAdmin() then
    ply:ChatPrint("Restricted!")
    return false
  end
end)

Thanks, exactly what I needed. Helped a lot :slight_smile: